Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android app link status is undefined

Tags:

android

I followed this android tutorial (http://developer.android.com/training/app-links/index.html) to implement app link feature in my app. However, when I check link polices with adb shell dumpsys package d, it shows up under "App verification status" header but status is "undefined", it doesn't show up under "App linkages for user 0" header at all.

What I did was in AndroidManifest.xml:

<activity
            android:name=".activities.SplashActivity"
            android:label="@string/app_name"
            android:noHistory="true" >
            <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="http" android:host="myhost" />
                <data android:scheme="https" android:host="myhost" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
</activity>

In my app, I use the real host. And this activity is the only one in my app which I set scheme and host. In my site, I added this

[{

    "relation": 

[

    "delegate_permission/common.handle_all_urls"

],
"target": 
{

    "namespace": "android_app",
    "package_name": "mypackage",
    "sha256_cert_fingerprints": 

            [
                "myfingerprint1",
                "myfingerprint2"
            ]
        }
    }

]

I tried to access this from browser with https://myhost/.well-known/assetlinks.json, it works. However, after I install the app, wait for a while and run adb shell dumpsys package d, it just says "undefined". Btw, I'm testing it on a M device.

like image 516
Fei Qu Avatar asked Feb 20 '16 00:02

Fei Qu


2 Answers

For me, the server was returning an invalid header with the assetlink file. You can hit the following URL to see if your assetlink file is valid. Just replace the example.com domain in the url with yours:

https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=http://example.com&relation=delegate_permission/common.handle_all_urls

like image 156
Nick Avatar answered Oct 03 '22 21:10

Nick


Faced the same issue.

For now I'm generating shortened URL from the app link url. This redirects it by default to the browser and browser then launches the app.

Doesn't fix the issue but is good enough for my requirement.

like image 35
Deepak Senapati Avatar answered Oct 03 '22 22:10

Deepak Senapati