问题
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
回答1:
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"
回答2:
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
来源:https://stackoverflow.com/questions/29189172/google-chrome-does-not-open-application-on-deep-link-on-android