带有旧版本Chrome的设备无法从Chrome自定义标签使用深层链接 [英] Deep link not working from Chrome Custom Tabs with device having old version of Chrome

查看:62
本文介绍了带有旧版本Chrome的设备无法从Chrome自定义标签使用深层链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从我的应用程序启动ChromeCustomTabs.chorme自定义选项卡中的页面显示一个按钮.单击该按钮时,将触发一个深层链接,例如 myapp://show/screen?id = 123 .我对应的Intent过滤器是这样的:

I launch ChromeCustomTabs from my app. The page in chorme custom tabs show a button. On click of that button a deep link is triggered, something like this myapp://show/screen?id=123. My corresponding intent-filter is 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:scheme="myapp"/>
                <data android:host="show"
                    android:path="/screen"/>
            </intent-filter>

问题:当用户点击该按钮时,仅当chrome版本是最新的或最新的74时,它才会启动我的应用..它不会触发我的应用较旧版本的chrome浏览器上的应用程序,例如在65. .

Problem: When user taps on that button, it launches my app only if the version of chrome is recent or latest 74.. Whereas it doesn't trigger my app on older versions of chrome browser e.g. on 65..

推荐答案

事实证明这是一个众所周知的问题.当我在浏览器中连接模拟器开发工具时,我收到一条 Navigation is Blocked 控制台消息.如果深层链接是由javascript触发的,则Google Chrome不会允许其打开应用.它必须是用户发起的操作.就我而言,在用户单击按钮之后,在触发Deeplink之前,ajax调用背后做了一系列事情.

It turns out to be a well known issue. I was getting a Navigation is Blocked console message when I connect my emulators dev tools in browser. Google Chrome won't let a deeplink to open an app, if it is triggered by a javascript. It has to be a user initiated action. In my case after the user clicks on button, there were series of things done behind ajax call, before deeplink was triggered.

作为一种解决方法,单击按钮并完成所有ajax调用的网络后,它将重定向到 new 中间屏幕.该屏幕创建有一个按钮供用户单击(继续).单击此按钮后,深层链接成功重定向到应用程序.

As a workaround, once the button is clicked and web is done with all the ajax calls, it redirects to new intermediate screen. This screen was created with a button for user to click(Continue). On click of this button, deeplink successfully redirected to app.

这篇关于带有旧版本Chrome的设备无法从Chrome自定义标签使用深层链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆