简体   繁体   中英

Using external deeplinks to open android app, opens chrome with 403 message

I've followed the docs for adding deeplink where we use https://mydomain.co/app or https://mydomain.co/app/details , etc to navigate to the app. So I've updated the manifest for this:

    <intent-filter android:autoVerify="true">
        <data
           android:host="mydomain.co"
           android:pathPrefix="/app"
           android:scheme="https" />

        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.BROWSABLE" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>

Generated the Digital Asset Links json file and added to the domain https://mydomain.co/.well-known/assetlinks.json

[
  {
    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "co.myapp.app",
      "sha256_cert_fingerprints":
        ["redacted:key"]
    }
  }
]


So when I test using adb command (ex. adb shell am start -d "https://mydomain.co/app/profile/edit_profile" ) it works perfectly but when I try using the link externally, it opens chrome and gives me 403. I'm not sure what I'm missing or what's wrong. Can somebody help me? Thanks in advance!

I found the solution: The main issue was the signature keys were not matching between Google Play and the release. That's because Google adds its own that can't be shared. So the only way to make it work was to upload the app in the Google Play Store. That means to make it work locally I need to add the signature key for the debug build into the Digital Asset Links json file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM