January 22, 2025 • Business, Mobile App, Knowledge • by Wahyu Untoro

Deeplink and Applink Integration: Enhancing Web and App User Experience

Deeplink and Applink Integration: Enhancing Web and App User Experience

Deeplink and Applink Integration: Enhancing Web and App User Experience

deeplink and applink - timedoor indonesia

Have you ever clicked on a link that directly opened an app installed on your device? This common occurrence in platforms like e-commerce is made possible through smart linking technologies. Here are several reasons why deeplink and applink integration is highly beneficial:

  1. Enhanced Security:

     

    Deeplinks protect users from scam threats by ensuring links cannot redirect to risky third-party apps, thus reducing the potential for malware attacks.

  2. Relevant Page Navigation:

     

    When users click on a specific product link, the app opens directly to the product page (if installed). If the app isn’t installed, users are still directed to the same page on the web version.

  3. Seamless User Experience:

     

    Deeplinks allow smooth transitions between apps and the web, creating a hassle-free user experience and improving user retention.

  4. Easy Link Sharing:

     

    With deeplinks, users can share links directly to specific pages. Without deeplinks, recipients would need to manually search for the page in the app.

Key Terms: Deeplink, Applink, and Weblink

Understanding key terms in this technology:

  • Weblink: Standard links commonly used, such as timedoor.net.
  • Deeplink: URLs resembling weblinks but capable of opening specific pages within an app. If the app isn’t installed, users are redirected to the web page.
  • Applink: URLs specifically designed to open pages within an app, such as app:timedoor.net.
weblink deeplink and applink - timedoor indonesia

Why Use Applink?

While deeplinks are effective for many cases, applinks are more suitable in certain scenarios:

  1. Ambiguous URL Path Identification

    If a website uses URLs like example.com/product_example for products and example.com/post for articles, apps might struggle to determine the appropriate page to open. Applinks help direct links explicitly to the app.

  2. Infinite Loop Issues in Webview

    Imagine you are using an app and you click on a link like “Privacy Policy” that should be opened within the app itself (via WebView). However, there is an issue: the link automatically triggers a deeplink designed to open the main application.

    As a result, the WebView in the app opens.

    The WebView triggers the deeplink to open the main app. The main app opens again to the WebView. This cycle continues (WebView > app > WebView > app), causing an endless loop.

    The outcome? The app hangs or even the device slows down due to excessive memory usage.

    Solution with Applink: To overcome this, applinks can be used to ensure certain links (such as the privacy policy or other pages) remain within the WebView without triggering an endless loop. With applinks, the app will know when to open links in the WebView and when to open the main app.

Implementing Deeplink and Applink

Android

To add deeplinks or applinks, modify the AndroidManifest.xml file with the following code:

xml
<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="https" />
    <data android:host="yourdomain.com" /> <!-- Replace with your domain -->
</intent-filter>

On the server, add an assetlinks.json file in the .well-known directory:

json
[
  {
    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "com.application.id", <!-- Replace with application ID -->
      "sha256_cert_fingerprints": [
        "10:9B:4B:1E:DC:E7:ED:92:5A:2B:41:E6:CA:1B:9B:DE:63:B2:08:58:1C:F4:8D:D8:25:F4:9D:CD:5E:4D:BE:48" <!-- Replace with app fingerprint -->
      ]
    }
  }
]

Validate with the following command:

bash
adb shell am start -a android.intent.action.VIEW \
-c android.intent.category.BROWSABLE \
-d https://yourdomain.com

iOS

For iOS, add your domain in Signing & Capabilities:

+ Capability > Associated Domains.

ios-deeplink-applink-timedoor-indonesia

 

Then add the following entry in info.plist:

xml
<key>CFBundleURLName</key>
<string>yourdomain.com</string> <!-- Replace with your domain -->
<key>CFBundleURLSchemes</key>
<array>
    <string>https</string>
</array>

On the server, add an apple-app-site-association file in the .well-known directory:

json
{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "teamId.com.application.id", <!-- Replace with {team id}.{bundle id} -->
        "paths": ["/page1", "/page2"] <!-- Add pages that can open the app -->
      }
    ]
  }
}

To verify, access:

https://app-site-association.cdn-apple.com/a/v1/yourDomain.com

Conclusion

Integrating deeplinks and applinks significantly improves user experience by ensuring smooth transitions between apps and the web, enhancing user satisfaction and security. Have you tried implementing this technology yet?

If you want to learn more about how Timedoor Indonesia can help you implement these technologies, feel free to reach out to us for a consultation. Our team of experts is ready to assist you in creating seamless and efficient user experiences.

Testing