34
Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock

Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Google Searching and Linking into Your iOS app with Universal Links

Chaise Hocking@ChaiseHock

Page 2: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

What is App Indexing?

Page 3: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Why do we need this?

Page 4: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Where have we seen it being used?

Page 5: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

• Improved user experience

• Continued logged in state

• Potential for customer interaction

What do these apps gain from App Indexing?

Page 6: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Demo App

https://venuesnearby.com/venue/4b058744f964a5209d8722e3

https://venuesnearby.com/search?term=melbourne

Page 7: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do
Page 8: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Deep Link vs Universal Link

Page 9: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Deep Link

venuesnearby://search?term=melbourne

custom scheme

• mailto://[email protected]

• tel://1-408-555-5555

Page 10: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Issues with Deep Links

• Cannot open when app is not installed

• Can only be shared (email etc.)

Page 11: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Universal Link (iOS 9 +)

own domain

https://venuesnearby.com/search?term=melbourne

• App and website share the same link

• If app is not installed, follows the link to website

Page 12: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Universal Links resolve the issues of Deep Links

• Can be shared or returned in web search

• Can be distributed around the web

Page 13: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

How do I setup App Indexing for my app?

Page 14: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Step 1: Satisfy Prerequisites

a. iPhone app

b. iPhone app supports routes

c. Mobile or Desktop website

Page 15: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Step 2: Link your app with your website AppName.entitlements

<plist version=“1.0"> <dict> <key>com.apple.developer.associated-domains</key> <array> <string>applinks:venuesnearby.com</string> <string>applinks:www.venuesnearby.com</string> </array> </dict></plist>

Page 16: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Step 3: Link your website with your app

{ "applinks": { "apps": [ ], "details": [ { "appID": "KADQL6585N.com.shinetech.venuesnearby", "paths": [ "/venue/*", "/search*" ] } ] }}

Page 17: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Step 4: Serve your association file

https://<domain>/apple-app-site-association

https://<domain>/.well-known/apple-app-site-association

• content-type: application/json

• Mustn’t be behind a redirect

• Must use an ssl certificate from a certificate authority

Page 18: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

www.google.com/apple-app-site-association

Page 19: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do
Page 20: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

So we’re setup…

What next?

Page 21: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

On app installation

• The iOS fetches the apple-app-site-association file from each associated domain

• Periodically fetches file in-case of updates

/apple-app-site-association

Your WebServer

Page 22: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

On link press

• The iOS checks each of it’s installed apps, if it has a matching domain and path

• If one matches, then it will open the link in the corresponding app

• Passes the link through to the app for action

Page 23: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

https://venuesnearby.com/venue/4b058744f964a5209d8722e3

"paths": [ "/venue/*", "/search*" ]

"paths": [ "/venue/*", "/search*" ]

"paths": [ "/venue/*", "/search*" ]

"paths": [ "/venue/*", "/search*" ]

"paths": [ "/venue/*", "/search*" ]

Page 24: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

So how does this help me search my app?

Page 25: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Some challenges, tips and common pitfalls

Page 26: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Challenge: Deploying locally

• Associated domain becomes your local instance of your website

• You need to serve your local website over ssl

• You must use a certificate from a certificate authority

Page 27: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

• iOS 10 minimum

• Send the link in an iMessages

• Tap the link

Tip: Testing on the Simulator

Page 28: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Pitfall: Robots.txt

Allow: /apple-app-site-association

Page 29: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Pitfall: Device user-agent

swcd (unknown version) CFNetwork/758.2.8 Darwin/15.0.0

Page 30: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

"paths": [ "*"]

"paths": [ "/venue/*", "/search*"] ✔

• Only allow urls your app can actually support

Tip: Defining your paths

Allow All URLs Restrict to known URLs

Page 31: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Challenge: Limitations to path matching

• Cannot include fragments in paths

• Cannot include query parameters in paths

Page 32: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

• Test your links in Google search response• Confirm request / response from apple-app-site-association

Tip: Debug with Charles

Page 33: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

In Summary

• Why we should use Universal Links

• Seen it in action

• The steps to set up Universal Linking

• Some debugging advice

Page 34: Google Searching and Linking into Your iOS app with ......Google Searching and Linking into Your iOS app with Universal Links Chaise Hocking @ChaiseHock What is App Indexing? Why do

Thanks

iOS app https://github.com/chaisehocking/VenuesNearby

mobile web app https://github.com/chaisehocking/VenuesNearbyMWeb