Android deep link opens the app only if link was added in Open by default

1.3k Views Asked by At

The title basically says it all, but maybe I can go into more details. Just running the app for the first time and trying to open it with a set deep link doesn't work. The link is opened in a browser. But if I go into the app's setting/Open by default and add the link manually, clicking on a deep link now opens my app. I've only tested this with a debug version of the app. Could this be an issue?

My intent filter in the manifest:

<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:host="${deepLinkHost}"
        android:pathPrefix="/deeplink/"
        android:scheme="https" />
</intent-filter>
1

There are 1 best solutions below

1
On

You must split your

<data
    android:host="${deepLinkHost}"
    android:pathPrefix="/deeplink/"
    android:scheme="https" />

to

<data android:host="${deepLinkHost}" />
<data android:pathPrefix="/deeplink/" />
<data android:scheme="https" />

and add

<intent-filter android:autoVerify="true">