uniapp判断第三方应用是否存在并打开应用
if(plus.runtime.isApplicationExist({pname:'com.s,action:'weixin://'})){
console.log("应用已安装");
if ( plus.os.name == "Android" ) {
plus.runtime.launchApplication( {pname:"com.android.browser"
,extra:{url:"http://www.html5plus.org"}}, function ( e ) {
alert( "Open system default browser failed: " + e.message );
} );
} else if ( plus.os.name == "iOS" ) {
plus.runtime.launchApplication( {action:"http://www.html5plus.org"}, function ( e ) {
alert( "Open system default browser failed: " + e.message );
} );
}
}else{
console.log("应用未安装");
}
点击查看代码
if(plus.runtime.isApplicationExist({pname:'com.s,action:'weixin://'})){
console.log("应用已安装");
if ( plus.os.name == "Android" ) {
plus.runtime.launchApplication( {pname:"com.android.browser"
,extra:{url:"http://www.html5plus.org"}}, function ( e ) {
alert( "Open system default browser failed: " + e.message );
} );
} else if ( plus.os.name == "iOS" ) {
plus.runtime.launchApplication( {action:"http://www.html5plus.org"}, function ( e ) {
alert( "Open system default browser failed: " + e.message );
} );
}
}else{
console.log("应用未安装");
}
蓦然、回首,那人就在灯火阑珊处