Configuring Server Files
Configuring apple-app-site-association, assetlinks.json, and the redirection.html files
Mobile app deep linking enables seamless navigation between web pages and app content, enhancing the user experience and engagement. To implement deep linking on iOS (using apple-app-site-association
), Android (using assetlinks.json
) and the app redirect (using redirection.html
), follow the instructions below.
Apple App Site Association (apple-app-site-association
)
apple-app-site-association
)1. Create the File:
Create a JSON file named
apple-app-site-association
(with no file extension) using a text editor.
2. JSON Structure:
The
apple-app-site-association
file should contain a JSON object with the following structure:
Replace
<TeamID>
with your Apple Team ID and<BundleID>
with your app's Bundle ID.
3. Specify Associated Domains:
In your Xcode project, go to the "Signing & Capabilities" tab.
Enable the "Associated Domains" capability.
Add the domain(s) and paths that you want to associate with your app using the
applinks:<domain>
format.
4. Add the File to the Server:
Place the
apple-app-site-association
file at the root of your domain (e.g.,https://www.yourdomain.com/.well-known/apple-app-site-association
).
5. Test Universal Links:
Deploy your app on a testing device through TestFlight or other testing methods.
Ensure the app is associated with the correct domain and paths.
Open a link that matches the specified domain and path on your testing device. It should open the app directly to the specified content.
Android Digital Asset Links (assetlinks.json
)
assetlinks.json
)1. Create the File:
Create a JSON file named
assetlinks.json
using a text editor.
2. JSON Structure:
The
assetlinks.json
file should contain a JSON array with the following structure:
Replace
your.app.package
with your Android app's package name.Obtain the
<SHA256_Fingerprint>
by running the following command:
3. Add the File to the Server:
Place the
assetlinks.json
file at the root of your domain (e.g.,https://www.yourdomain.com/.well-known/assetlinks.json
).
Redirecting to the Apple App Store & Google Play Store (redirection.html
)
redirection.html
)1. Create the File:
Create a JSON file named
redirection.html
using a text editor.
2. HTML Structure:
The
redirection.html
file should contain the following structure:
Replace the variables androidUrl and iOSUrl with your own app store links.
Replace the variable nonMobileUrl with a fallback link in the case that someone is opening the link from a non-mobile device.
3. Add the File to the Server:
To achieve the desired behavior where any URL in the format of https://qr.yourdomain.com/{*}
is redirected to the "redirection.html" file, you need to set up server configuration rules.
Keep in mind that the implementation specifics may vary depending on the web server you are using (e.g., Apache, Nginx) and the server-side scripting language (e.g., PHP, Node.js) you have at your disposal. The redirection can be achieved through server configuration files or using server-side code to handle the redirection logic.
Additional Path Parameters
Path parameters in deep linking simplify user access by directing them to specific content or features within apps, aiding personalization and tracking. They enhance sharing and engagement, offering a seamless experience.
Include paths in the Deeplink Domain on the 'For Developers' page of the Creator Portal if you want to add these extra path parameters.
More information on path parameters for deep links can be found below.
Verifying Deep Link Setup
To verify that your deep link setup is working correctly, you can use Branch's "Associated Domains" validation tool to test your apple-site-association
file and follow this developer guide for your assetslinks.json
file.
Last updated