科尔多瓦在新的应用程序窗口中打开应用程序链接安卓



>我在科尔多瓦遇到一个问题,我想链接到手机上安装的另一个应用程序,但该应用程序在我的科尔多瓦应用程序中打开并且没有在新的应用程序窗口中打开该应用程序。

看到这里有 2 个 Yammer 应用程序的实例,一个在我的 Cordova 应用程序 (Alkmaar( 中

我正在使用window.open(url,'_system'(;并且插件已安装在AppBrowser中。 代码片段:

$("body").on("click","a.tile", function(e){
var url = $(this).data("url");
var playstore = $(this).attr("data-playstore");
var appstore = $(this).attr("data-appstore");
var deeplink = $(this).attr("data-deeplink");
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || $(window).width() < 960 ) {
window.open(deeplink, '_system');

这里的问题是,如果我在 Yammer 中登录,应用程序会崩溃,因为它可能有 2 个登录会话。

有什么方法可以确保它在新窗口中打开已安装的应用程序?

PS:此问题不会在iOS上发生,仅在Android上发生

您可以使用以下 java 代码:

Intent LaunchIntent = this.cordova.getActivity().getPackageManager().getLaunchIntentForPackage("appPackage");
this.cordova.getActivity().startActivity(LaunchIntent);

或者您可以使用以下插件来启动应用程序

https://github.com/dmedvinsky/cordova-startapp

相关内容

最新更新