5

The docs state that both my instant and installed app should implement App Links. Why should the installed app implement App Links as well, since I only want my instant app URLs to be surfaced correctly in Google Search with the instant badge? Also, what are the best practices?

AdamK
  • 21,199
  • 5
  • 42
  • 58
Arun Venkatesan
  • 403
  • 3
  • 7

2 Answers2

8

Yes - app links enables seamless link resolution to your app, installed or instant. In order for Google Search to surface results for either your installed or instant app, you must setup app links properly for both. In addition, to avoid degrading the user experience from instant to installed, all URLS supported by the instant app should also be supported by the installed app. Hence, as the docs state, both the instant and installed app should implement app links."

Here are the best practices:

  • Set autoVerify=true in at least one intent filter in both the instant and installed app manifest.
  • Host one assetlinks.json per subdomain. The file must be served from /.well-known/assetlinks.json on each https subdomain.
  • assetlinks.json file must be valid json (correct syntax, no BOM for instance) served with header "Content-Type: application/json" and served with an HTTP 200 status on each domain (no redirects)
  • assetlinks.json file location must be accessible to bots, e.g. robots.txt needs. This means if you include internal urls in the manifest that are only accessible internally, the validation will fail.
  • Ensure all path claims in your instant app are also in your published regular app.
  • All declared intent filters must support both http and https in the scheme.
  • Do not use wildcards hosts in your intent filters (e.g.) In *.example.local, the * will be dropped and example.local will be indexed.
  • Only one instant app can be supported for each domain. Multiple Instant Apps cannot be associated with the same domain.
  • Ensure your assetlinks.json is valid for your most popular search results using the tool described in “Confirm the Digital Asset Links files” on the App Link support page.
  • Test your app links here.
Arun Venkatesan
  • 403
  • 3
  • 7
2

Instant Apps and App Links

As you noted, Instant Apps rely on App Links to work. However, not all devices support Instant Apps, and if your full app is installed, you will want your users to be sent there instead of the Instant App version. So your full app still needs to support App Links too.

The difference between a regular app and an Instant App is that the device will only load a single Activity in response to the App Link the user clicks, instead of needing to download the full package through the Play Store. It's a more seamless experience for the user, but the underlying technology works the same way.

Passing Context Between Instant and Full App

You also probably need some way to make sure your users are handed off between app versions seamlessly, if they choose to download the full version. Android doesn't offer this by default (surprisingly), so you'll either need to build it yourself or use a service like Branch.io (full disclosure: I'm on the Branch team).

Alex Bauer
  • 13,147
  • 1
  • 27
  • 44