I am trying to implement deep linking to my android app.
I have added the following code to my AndroidManifest.xml
<intent-filter android:autoVerify="true"><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter><intent-filter><action android:name="android.intent.action.VIEW" /><category android:name="android.intent.category.DEFAULT" /><category android:name="android.intent.category.BROWSABLE" /><data android:scheme="mygainplan" /></intent-filter><intent-filter><action android:name="android.intent.action.VIEW" /><category android:name="android.intent.category.DEFAULT" /><category android:name="android.intent.category.BROWSABLE" /><data android:scheme="http" /><data android:scheme="https" /><data android:host="www.my-gainplan.com" /><data android:pathPrefix="/workouts" /></intent-filter>
I am using react-navigation for handling deep links inside my app with this config
const linking = { prefixes: ['https://www.my-gainplan.com','mygainplan://','https://my-gainplan.com', ], config: { screens: { MyWorkouts: 'workouts', }, },};
To make this work with my website, I have added the following assetlinks.json to my website
[ {"relation": ["delegate_permission/common.handle_all_urls"],"target": {"namespace": "android_app","package_name": "com.mygainplan","sha256_cert_fingerprints": ["FA:C6:17:45:DC:09:03:78:6F:B9:ED:E6:2A:96:2B:39:9F:73:48:F0:BB:6F:89:9B:83:32:66:75:91:03:3B:9C" ] } }]
The sha256 is the one from the android debug keystore.
When I run the app in debug mode, links with the prefix mygainplan:// work just fine, but links from the website (https://www.my-gainplan.com/workouts) just open the web browser and not the app. Why is this happening?