UNI-APP 实现跳转其他APP

2,337 阅读1分钟

uni 文档

uni-app 中打开外部应用

调用第三方程序

判断第三方程序是否已存在

UNIAPP实现跳转其他的APP 在安卓中,在开发的过程,需要先获取外部APP的包名才能实现跳转外部APP 而IOS需要获取对应的“URLscheme”才能跳转外部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);  
    });  
}