busylee
busylee

Reputation: 2560

Android deeplinking default handler

I am trying to use last default handling feature for deep linking site and app, introduced in Marshmallow release. I have done three steps, as described here (https://developer.android.com/training/app-links/index.html)

  1. I have created intent handlers in my apk

            <data android:scheme="http"
                android:path="/cat.html"
                android:host="kino.tryremember.ru"/>
        </intent-filter>
    </activity>
    <activity
        android:name=".DogActivity"
        android:exported="true"
        android:launchMode="singleTop">
        <intent-filter
            android:label="@string/app_name"
            android:autoVerify="true"
            tools:ignore="UnusedAttribute">
            <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"
                android:path="/dog.html"
                android:host="kino.tryremember.ru"/>
        </intent-filter>
    </activity>
    
  2. I have added assetslink json file on my test website (https://kino.tryremember.ru/.well-known/assetlinks.json)

As I noticed my app handle web site links and when I click in link on search result in google search in chrome for example it gives me chooser dialog, but as describe in docs (link above) there will be auto detection of default handler in fact my app would be default handler, cuz I have done all conditions.

But during installation I could see in logcat something like that

08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier:Verification result: checking for a statement with source a <
08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier:   a: "https://kino.tryremember.ru"
08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier: >
08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier: , relation delegate_permission/common.handle_all_urls, and target b <
08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier:   a: "com.busylee.appindexingexample"
08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier:   b <
08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier:     a: "A7:93:BA:D8:DD:ED:F4:40:08:7B:C7:43:49:60:C3:4F:31:34:54:2F:58:AC:BE:D9:16:CB:C5:B9:2B:A3:B9:CA"
08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier:   >
08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier: >
08-10 17:39:24.821  4755 19896 I SingleHostAsyncVerifier:  --> false.
08-10 17:39:24.821  4755 19896 D SingleHostAsyncVerifier: Remaining verification failures before we've exhausted all certs: 0
08-10 17:39:24.821  4755 19896 D StatementServiceResFut: setResult on host: a <
08-10 17:39:24.821  4755 19896 D StatementServiceResFut:   a: "https://kino.tryremember.ru"
08-10 17:39:24.821  4755 19896 D StatementServiceResFut: >
08-10 17:39:24.821  4755 19896 D StatementServiceResFut: : false
08-10 17:39:24.821  4755 19895 I IntentFilterIntentSvc: Verification 3 complete. Success:false. Failed hosts:kino.tryremember.ru.

I can not understand what's wrong. Have anyone any idea about what I have missed or are doing wrong?

Upvotes: 3

Views: 1217

Answers (1)

busylee
busylee

Reputation: 2560

I have found my fail. It is strict to add header Content-Type application-json for .well-known/assetlinks.json file, or you will face same error as me.

Upvotes: 1

Related Questions