[英]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.