Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome does not open application on Deep Link on Android

Google Chrome wouldn't launch my app on Deep Link, however, the app gets launched if I run it from Firefox. I use "onkat://" just as an example as I just want to get the app launched first.

Following is the code in my AndroidManifest.xml

<activity
            android:name="MainActivity"
            android:configChanges="keyboardHidden|screenSize|orientation"
            android:icon="@drawable/something"
            android:label="@string/appName"
            android:launchMode="singleTask"
            android:screenOrientation="user" >

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

            <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="onkat"/>

            </intent-filter>
</activity>

Any ideas? If Google Chrome requires anything more in the Intent-filter? or a work-around. I tested on multiple devices, except Chrome the other browsers run my app when I simply enter "onkat://"

Observation: I think Google Chrome doesn't work with Deep Link in general. Even Facebook deep link doesn't work on it, while it works on other browsers (fb://). Also, google chrome Deep Link doesn't work for iOS

like image 441
Sachin Avatar asked Mar 21 '15 23:03

Sachin


People also ask

Why some sites are not opening in Chrome Android?

If it works in another browser, try uninstalling and reinstalling Chrome. There could be something wrong with your Chrome profile that's causing problems. Uninstall Chrome and make sure to check the box to delete browsing data. Then, reinstall Chrome.

How do I open a deep link on Android?

Select Open deep link URL in a browser option. Click Next. For Android, select Open the deep link in your Android app. Then select your app from the dropdown, in this case the com.


2 Answers

Chrome has changed how it handles intents launched from the Chrome browser app.

<a href="intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end"> Take a QR code </a>

The answer can be found here: https://developer.chrome.com/multidevice/android/intents

like image 111
Mark B Avatar answered Sep 20 '22 22:09

Mark B


In the manifest file your intent filter should be like this:

        <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="productlist"
                android:path="/"
                android:scheme="westwing" />
        </intent-filter>

and on the browser side it should be like this:

"intent://productlist/#Intent;scheme=westwing;package=de.westwing.android;end"
like image 43
Metwalli Avatar answered Sep 19 '22 22:09

Metwalli