// 判断用户是否安装支付宝
checkAlipay(instal) {
if (plus.runtime.isApplicationExist({
pname: 'com.eg.android.AlipayGphone',
action: 'alipay://'
})) {
console.log("支付宝应用已安装");
} else {
// uninstal()
console.log("支付宝应用未安装");
plus.runtime.openURL('https://d.alipay.com/?nojump=true');
}
},
// 判断用户是否安装QQ
checkQQ(instal) {
if (plus.runtime.isApplicationExist({
pname: 'com.tencent.mobileqq',
action: 'mqq://'
})) {
console.log("QQ应用已安装");
} else {
// uninstal()
console.log("QQ应用未安装");
plus.runtime.openURL('https://im.qq.com/mobileqq/touch/android/');
}
},
// 判断用户是否安装新浪微博
checkSinaweibo(instal) {
if (plus.runtime.isApplicationExist({
pname: 'com.sina.weibo',
action: 'sinaweibo://'
})) {
console.log("新浪微博应用已安装");
} else {
// uninstal()
plus.runtime.openURL('https://c.weibo.cn/');
console.log("新浪微博应用未安装");
}
},
// 判断用户是否安装微信,传入判断函数
checkWeixin(instal) {
if (plus.runtime.isApplicationExist({
pname: 'com.tencent.mm',
action: 'weixin://'
})) {
console.log("微信应用已安装");
} else {
// uninstal()
//
plus.runtime.openURL('https://weixin.qq.com/d ');
console.log("微信应用未安装");
}
}
判断某app是否安装
最新推荐文章于 2024-05-11 19:18:06 发布