I'm working on a React Native app that is supposed to open when you click on a link that leads to the website. The iOS and Android 10 versions work just fine.
However, on Android 12 instead of opening the app the link opens in the browser. I have .well-known/assetlinks.json
file in place that looks like this:
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "com.example",
"sha256_cert_fingerprints": [
"AA:BB:CC:DD:EE:FF...", // staging key fingerprint
"AA:BB:CC:DD:EE:FF..." // prod key fingerprint
]
}
}
]
I read this article through and through trying to find a solution to this.
I tried running adb shell pm verify-app-links --re-verify com.example
and executing adb shell pm get-app-links com.example
, but I keep getting the result:
Domain verification state:
example.com: legacy_failure
I also tried the Statement List Generator and Tester tool by Google. It says that there's no app deep linking permission on www.example.com, but after a few more tries it shows success.
My AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example">
<application ...>
<.../>
<activity ...>
<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="example.com" />
</intent-filter>
<.../>
</activity>
<.../>
</application>
</manifest>
I tried changing android:host
to www.example.com
or *.example.com
but that didn't seem to work either.