Deep Linking
Deep Linking enable a seamless user experience by opening specific app pages when users click on corresponding links. Configuring Deep Linking ensures that clicking an http://
or https://
link matching a specified domain opens the link within your app instead of a mobile browser. It's recommended to add your hostname with and without the 'www' prefix.
-
Click on link handling
-
Then click on deep linking settings
-
Add URL matching a specified domain opens the link within your app instead of a mobile browser.
Android Configuration
Default Behavior:
- Android Deep Linking typically display a disambiguation dialog, prompting users to choose whether to open the link in your app or in a mobile browser.
App Link Verification:
- To bypass the disambiguation prompt and open links directly in your app, you can enable App Link Verification. This requires adding a configuration file to your website at
/.well-known/assetlinks.json
to prove you control the referenced domain.
Steps for Configuration:
-
Create the Assetlinks File:
- Add a
/.well-known/assetlinks.json
file to your website. This file should reference your app's package name and include a SHA-256 fingerprint of your app's signing certificate.
Example of
assetlinks.json
:[ { "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "com.example.yourapp", "sha256_cert_fingerprints": ["<your_sha256_fingerprint>"] } } ]
- Add a
-
Verify Configuration:
- Visit Google’s Statement List Generator and Tester (opens in a new tab).
- Enter your app package name and the SHA-256 fingerprint from the assetlinks.json, then click "Test Statement" to ensure it's configured correctly.
-
Repeat for Each Hostname:
- Perform the above steps for each hostname you intend to use.
Android Documentation:
- For detailed instructions, refer to the Android Documentation (opens in a new tab).
iOS Configuration
Default Behavior:
- iOS always presents a confirmation screen when a user clicks a Deep Linking.
Requirements:
-
Provisioning Profile:
- In the provisioning profile associated with your app ID, add "Associated Domains" under App Services.
-
Configuration File:
- Add an
/.well-known/apple-app-site-association
file to your website. This file must include your TEAMID from your Apple Developer account.
- Add an
Steps for Configuration:
-
Add Configuration File:
- Place the
/.well-known/apple-app-site-association
file on your website to prove domain ownership.
Example of
apple-app-site-association
:{ "applinks": { "apps": [], "details": [ { "appID": "TEAMID.com.example.yourapp", "paths": [ "/path/to/content/*" ] } ] } }
- Place the
-
Test Configuration:
- Test your association file using the AASA Validator (opens in a new tab).
iOS Tips:
-
Path Requirement:
- Deep Linking will not work unless a PATH is specified in the URL. For example,
http://example.com
will NOT work, buthttp://example.com/PATH
will.
- Deep Linking will not work unless a PATH is specified in the URL. For example,
-
Multiple Subdomains:
- If your site uses multiple subdomains (e.g.,
example.com
,www.example.com
,support.example.com
), each subdomain requires its own entry in the Associated Domains Entitlement and must serve its own/.well-known/apple-app-site-association
file.
- If your site uses multiple subdomains (e.g.,
-
Hosting Requirements:
- The
/.well-known/apple-app-site-association
file must be hosted with aContent-Type: application/json
HTTP header, usehttps://
with a valid SSL certificate, and return a200 HTTP Status Code
with no redirects.
- The
Apple Documentation:
- For detailed instructions, refer to Apple's Documentation for Universal Links (opens in a new tab) and Associated Domains (opens in a new tab).
Deep Linking Setup Summary
Android:
- Use
/.well-known/assetlinks.json
for domain verification. - Test configuration with Google's Statement List Generator and Tester.
- Repeat for each hostname.
iOS:
- Use
/.well-known/apple-app-site-association
for domain verification. - Ensure provisioning profile, and associated domains.
- Test configuration with AASA Validator.
- Host configuration files with appropriate headers and SSL.