网站首页
uniapp-开发中常用的打开第三方APP
发布时间:2020-11-18 02:34查看次数:3301
launchApp() { let _this = this; // 判断平台 if (plus.os.name == 'Android') { plus.runtime.launchApplication( { pname: 'com.taobao.taobao' }, function(e) { console.log('Open system default browser failed: ' + e.message); } ); } else if (plus.os.name == 'iOS') { plus.runtime.launchApplication({ action: 'taobao://' }, function(e) { console.log('Open system default browser failed: ' + e.message); }); } }
常用URLscheme
复制代码[ // 只在 ios 中生效 { name: 'App Store', scheme: 'itms-apps://' }, { name: '支付宝', pname: 'com.eg.android.AlipayGphone', scheme: 'alipay://' }, { name: '淘宝', pname: 'com.taobao.taobao', scheme: 'taobao://' }, { name: 'QQ', pname: 'com.tencent.mobileqq', scheme: 'mqq://' }, { name: '微信', pname: 'com.tencent.mm', scheme: 'weixin://' }, { name: '京东', pname: 'com.jingdong.app.mall', scheme: 'openApp.jdMobile://' }, { name: '新浪微博', pname: 'com.sina.weibo', scheme: 'sinaweibo://' }, { name: '优酷', pname: 'com.youku.phone', scheme: 'youku://' } ]
关键字词:uniapp##