Search code examples
androiddeep-linking

Android. Deep linking doesn't work with http/https scheme


I added a deep linking to my Android app this way:

<activity
        android:name=".views.DeepLinkingActivity"
        android:exported="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="https"
                android:host="example.com"/>
        </intent-filter>
    </activity>

When I click on https://example.com I get redirected to the web site.

When I change android:scheme="https" to android:scheme="appscheme" it works and it redirects me to my app.

How to force my app to be opened via https scheme?

UPDATE

I added a subdomain and it still doesn't work.

<activity
        android:name=".views.DeepLinkActivity"
        android:exported="true">
        <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="https"
                android:host="www.example.ru"/>
        </intent-filter>
    </activity>

Solution

  • Hi please use the following data and try also refer this doc

    <intent-filter>
                    <data
                        android:scheme="ou unique scheme(appname,package name)" />
    
                    <action android:name="android.intent.action.VIEW" />
                    <category android:name="android.intent.category.BROWSABLE" />
                    <category android:name="android.intent.category.DEFAULT" />
                </intent-filter>
    

    OR

      <data
                    android:scheme="you unique scheme(appname,package name)"
                    android:host="www.example.ru"/>