简体   繁体   English

从Android上的网络浏览器深度链接到cordova应用程序会在同一浏览器窗口中打开应用程序

[英]deep linking into a cordova app from a web browser on android opens app within the same browser window

On Android, if I open the mobile web browser and click on a deep link it opens the app, but doesn't open a new window and opens it within the same browser window. 在Android上,如果我打开移动网络浏览器并单击一个深层链接,它将打开该应用程序,但不会打开新窗口,而是在同一浏览器窗口中打开它。

How can I make it open an app rather than having the cordova web process run within the same window? 如何使它打开一个应用程序,而不是让cordova Web进程在同一窗口中运行? I don't want to just put in target=_blank and have it spawn another web window, I'd like it to be an app window proper. 我不想只放入target = _blank并产生另一个Web窗口,我希望它是适合应用程序的窗口。

If you open the app manager the deep linked app that it opened in the same window will show up as a web page - however if you look at the debugger it will show up as an app proccess. 如果打开应用程序管理器,则在同一窗口中打开的深层链接应用程序将显示为网页-但是,如果您查看调试器,它将显示为应用程序进程。

I faced exactly the same problem, but found the solution. 我遇到了完全相同的问题,但是找到了解决方案。 It has nothing to do with Cordova actually. 实际上与科尔多瓦无关。

If you want the intent that is fired to be handled by the instance of the app that is already open you need to change the launch mode of your Android app. 如果您希望由已打开的应用程序实例处理触发的意图,则需要更改Android应用程序的启动模式。 If you specify singleTask as the launch mode this will tell Android to fire the intent on the instance of your app that is already launched. 如果您将singleTask指定为启动模式,这将告诉Android在已启动的应用程序实例上触发意图。 By default it will use the default launch mode which will launch a new instance. 默认情况下,它将使用default启动模式,它将启动新实例。

In Cordova you can specify it by adding the following line to your config.xml 在Cordova中,您可以通过将以下行添加到config.xml来指定它

<preference name="AndroidLaunchMode" value="singleTask"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 来自浏览器的深度链接无法运行 Android - Deep Linking from browser not working Android Android:将从服务器发送的 url 转换为 textview,这样在单击该 textview 时,应用程序会在浏览器窗口中打开该 url? - Android: convert a url sent from a server into a textview, such that on click on that textview the app opens that url in a browser window? Android 深度链接重定向只打开浏览器,不打开应用程序 - Android deeplink redirection only opens browser, not app Android 应用程序链接打开浏览器而不是应用程序并支持 web 链接在应用程序信息中被禁用 - Android App Link opens browser instead of App and supported web link is disabled in app info Android深入链接到应用程序 - Android deep linking into an app 从WEB浏览器启动Android App - Launch Android App from WEB browser 将数据从网络浏览器发送到android应用 - Send data from web browser to android app Android 浏览器中的深层链接无法打开应用程序 - App is not opened by deep link in Android browser Android 深度链接不从浏览器加载,即使是简单的教程 - Android deep linking not loading from browser, even from simple tutorial 如何将Cordova应用程序添加到Android中的浏览器列表 - How to add Cordova app to browser list in Android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM