Google Chrome无法在Android上的Deep Link上打开应用程序

问题描述 投票:2回答:2

谷歌浏览器无法在Deep Link上启动我的应用程序,但是,如果我从Firefox运行该应用程序,它就会启动。我使用“onkat://”作为示例,因为我只想先启动应用程序。

以下是我的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>

有任何想法吗?如果Google Chrome在Intent过滤器中需要更多内容?或解决方法。我在多个设备上测试过,除了Chrome,其他浏览器在我输入“onkat://”时运行我的应用程序

观察:我认为Google Chrome一般不适用于Deep Link。甚至Facebook深层链接也不起作用,而它适用于其他浏览器(fb://)。此外,谷歌浏览器Deep Link不适用于iOS

android google-chrome android-intent deep-linking
2个回答
5
投票

Chrome已更改其处理从Chrome浏览器应用启动的意图的方式。

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

答案可以在这里找到:https://developer.chrome.com/multidevice/android/intents


4
投票

在清单文件中,您的intent过滤器应如下所示:

        <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>

在浏览器方面它应该是这样的:

"intent://productlist/#Intent;scheme=westwing;package=de.westwing.android;end"
© www.soinside.com 2019 - 2024. All rights reserved.