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)

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:

  "applinks": {
    "apps": [],
    "details": [
        "appID": "<TeamID>.<BundleID>",,
        "paths": [
  • 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.,

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.

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:

    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "",
      "sha256_cert_fingerprints": ["<SHA256_Fingerprint>"]
  • Replace with your Android app's package name.

  • Obtain the <SHA256_Fingerprint> by running the following command:

  • keytool -list -v -keystore your_keystore.keystore

3. Add the File to the Server:

  • Place the assetlinks.json file at the root of your domain (e.g.,

Redirecting to the Apple App Store & Google Play Store (redirection.html)

1. Create the File:

  • Create a JSON file named redirection.htmlusing a text editor.

2. HTML Structure:

  • The redirection.html file should contain the following structure:

   <meta http-equiv=Content-Type content="text/html; charset=windows-1252">

    const getMobileOS = () => {
        const ua = navigator.userAgent;
        let redirectUrl;
        const androidUrl = "";
        const iOSUrl = "";
        const nonMobileUrl = "";
        if (/android/i.test(ua)) {
            redirectUrl = androidUrl;
        } else if (/iPad|iPhone|iPod/.test(ua)) {
            redirectUrl = iOSUrl;
        } else {
            redirectUrl = nonMobileUrl;
        setTimeout(() => {
            window.location.href = redirectUrl;
        }, 3000);

  • 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{*} 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.

iOS allowing apps and websites to link to your content
Android deep linking

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