Gaurav Arora
Gaurav Arora

Reputation: 17274

Android: Deep linking web urls

I want to integrate deep-linking for web-urls in Android. However, I couldn't get it working. Following are the steps I'm following:

Step 1. AndroidManifest.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" android:host="niksguitarist.000webhostapp.com" android:pathPrefix="/asset"/>
</intent-filter>

<meta-data android:name="asset_statements" android:resource="@string/asset_statements" android:autoVerify="true"/>

Step 2. res/values/strings.xml:

<string name="asset_statements">
   [{
   \"relation\": [\"delegate_permission/common.share_location\"],
   \"target\": {
   \"namespace\": \"web\",
   \"site\": \"https://niksguitarist.000webhostapp.com/\"
   }
   }]
</string>

Step 3. Host assetLinks on server:

https://niksguitarist.000webhostapp.com/.well-known/assetlinks.json

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.sprinklr.distributedapp",
    "sha256_cert_fingerprints": ["A8:D4:5F:DC:AE:67:D6:90:46:23:07:8B:23:89:0B:11:AB:49:4E:B0:C7:87:50:0C:59:32:01:A0:4A:88:1A:5A"]
  }
}]

Now, when I try to open https://niksguitarist.000webhostapp.com/asset on mobile browser (chrome or firefox), it doesn't route me to my app.

Can someone please suggest on what I am doing wrong?

Upvotes: 1

Views: 695

Answers (1)

Gaurav Arora
Gaurav Arora

Reputation: 17274

App link won't work if you are trying to open url directly from browser. It would only work if you are trying to open url from a non-browser app - note, chat or any other app

Upvotes: 1

Related Questions