ios 审核没通过,手机上没有安装QQ和微信的话掉不起网页授权,求解????
紫竹林
- 发布:2016-09-07 13:14
- 更新:2016-09-07 23:08
- 阅读:2410
赵梦欢 - 专注前端,乐于分享!
最好判断是否安装有对应客户端,然后将没有安装的内容隐藏。
// 判断本地是否安装客户端
var isInstalled = function (id) {
if (mui.os.android) {
var main = plus.android.runtimeMainActivity();
var packageManager = main.getPackageManager();
var PackageManager = plus.android.importClass(packageManager)
var packageName = {
"qq": "com.tencent.mobileqq",
"weixin": "com.tencent.mm",
"sinaweibo": "com.sina.weibo"
}
try {
return packageManager.getPackageInfo(packageName[id], PackageManager.GET_ACTIVITIES);
} catch (e) {
mui.toast(e)
}
} else {
switch (id) {
case "qq":
var TencentOAuth = plus.ios.import("TencentOAuth");
return TencentOAuth.iphoneQQInstalled();
case "weixin":
var WXApi = plus.ios.import("WXApi");
return WXApi.isWXAppInstalled()
case "sinaweibo":
var SinaAPI = plus.ios.import("WeiboSDK");
return SinaAPI.isWeiboAppInstalled()
default:
break;
}
}
}
紫竹林 (作者)
安卓能监测出来,苹果检查不出来,isInstalled(“wei'xin”)返回值是空的????
2016-09-19 10:58
紫竹林 (作者)
isInstalled("weixin")
2016-09-19 11:01