Search code examples
flutterfirebaseapplinks

Why is my assetlinks.json file not redirecting to my flutter app?


Initially my configuration for app-links was working fine until I did not test it for a while (thinking it would still work) and now I am not able to find any possible misconfigurations. When I click on an app-link, I am only getting redirected to the browser and all I am seeing is the

Welcome Firebase Hosting Setup Complete

site.

  • I hosted an assetlinks.json file on my initialized firebase-hosting application under the directory of "https://web-url/.well-known/assetlinks.json",
  • I configured my Manifest file as described in this article:
 <meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
 <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" 
     android:host="weburl.web.app" 
     android:pathPrefix="/myPathPrefix"
     />
  • I got my assetlinks.json file configured like
[
  {
    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "com.example.myapp",
      "sha256_cert_fingerprints": [
        ""
      ]
    }
  }
]

Solution

  • I have found a solution to the problem:

    Although the Android manifest file was configured correctly, the “supported urls” setting on my test device was not set correctly.

    The setting can be found under

    Apps > YourApp > default settings > supported web addresses