【问题标题】:Google Chrome does not open application on Deep Link on AndroidGoogle Chrome 无法在 Android 上的 Deep Link 上打开应用程序
【发布时间】:2015-05-25 04:46:25
【问题描述】:

Google Chrome 不会在 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>

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

观察:我认为谷歌浏览器一般不支持 Deep Link。即使是 Facebook 深层链接也不能在它上面运行,而它在其他浏览器 (fb://) 上也能运行。此外,谷歌浏览器深度链接不适用于 iOS

【问题讨论】:

  • 问题已在 chrome 中修复,我也面临同样的问题。

标签: android google-chrome android-intent deep-linking


【解决方案1】:

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

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

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

【讨论】:

  • 这是我的数据, 我形成了这样的href, 打开应用程序,但它不起作用。
  • 从 chrome 浏览器中,始终打开 google playstore,即使已安装该应用。
  • 从 chrom 浏览器打开链接时尝试了相同的实现总是打开 playstore 应用程序并直接到应用程序,有没有办法解决这个问题?
  • 如果我想在没有用户点击的情况下执行此操作(例如,当页面加载时)
【解决方案2】:

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

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

【讨论】:

    猜你喜欢
    • 2015-09-28
    • 1970-01-01
    • 2013-10-18
    • 2021-08-21
    • 1970-01-01
    • 1970-01-01
    • 2018-08-14
    • 2022-10-21
    • 1970-01-01
    相关资源
    最近更新 更多