uni 文檔
uni-app 中打開外部應(yīng)用
調(diào)用第三方程序
判斷第三方程序是否已存在
UNIAPP實(shí)現(xiàn)跳轉(zhuǎn)其他的APP
在安卓中正罢,在開發(fā)的過程,需要先獲取外部APP的包名才能實(shí)現(xiàn)跳轉(zhuǎn)外部APP
而IOS需要獲取對應(yīng)的“URLscheme”才能跳轉(zhuǎn)外部APP畦粮,所謂的URLscheme就是指下面代碼中的“taobao://”
if (plus.os.name == 'Android') {
plus.runtime.launchApplication(
{
pname: 'com.example.thunder'
},
(e) => {
console.log('Open system default browser failed: ' + e.message)
}
)
} else if (plus.os.name == 'iOS') {
plus.runtime.launchApplication({ action: 'taobao://' }, (e) => {
console.log('Open system default browser failed: ' + e.message);
});
}