1、之前三方登录qq 微信的入口图标不管用户手机中有未安装qq、微信,被拒绝;
2、现在改为如果用户手机中未安装qq、微信则不显示相应的登录图标,还是被拒;
3、这到底是怎么回事?有什么好的解决方案?
ios 被拒信息
Guideline 4.2.3 - Design - Minimum Functionality
We were required to install the QQ app before we could log in via QQ. Users should be able to log in with QQ and access their accounts without having to install any additional apps.
Next Steps
If you would like to offer authentication through QQ, please use a mechanism that allows users to log in with QQ from within your app without first having to install an additional app.
We recommend implementing the Safari View Controller API to display web content within your app. The Safari View Controller allows the display of a URL and inspection of the certificate from an embedded browser in an app so that customers can verify the webpage URL and SSL certificate to confirm they are entering their sign in credentials into a legitimate page.
Resources
For additional information on the Safari View Controller API, please review the What's New in Safari webpage.
app中的安装和显示判断逻辑使用后的HBuilder中的登录模板
plus.oauth.getServices(function(services) {
var flag = false;
for(var i in services) {
var service = services[i];
auths[service.id] = service;
if(~authBtns.indexOf(service.id)) {
var isInstalled = app.isInstalled(service.id);
if(isInstalled) {
flag = true;
var btn = document.createElement('div');
//如果未安装,则为不启用状态
btn.setAttribute('class', 'oauth-btn');
btn.authId = service.id;
btn.style.backgroundImage = 'url("images/' + service.id + '.png")'
oauthArea.appendChild(btn);
}
}
}
if(!flag){
document.getElementById("footer").style.display = "none";
}
/**
* 获取本地是否安装客户端
**/
owner.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"
}
try {
return packageManager.getPackageInfo(packageName[id], PackageManager.GET_ACTIVITIES);
} catch(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()
default:
break;
}
}
}
miskss (作者)
关键是本地测试,如果未安装qq或微信,图标已经隐藏掉了
2018-03-25 11:02