uni.getProvider({
service: 'oauth',
success: function(res) {
if (~res.provider.indexOf('apple')) {
// 登录
uni.login({
provider: 'apple',
success: function(loginRes) {
console.log('-------获取openid(unionid)-----');
console.log(JSON.stringify(loginRes));
// 获取用户信息
uni.getUserInfo({
provider: 'apple',
success: function(infoRes) {
console.log('-------获取苹果授权信息-----');
console.log(JSON.stringify(infoRes));
_this.navigateBack();
},
fail: function(res) {
console.log(JSON.stringify(res));
}
});
},
fail(res) {
}
});
}
}
});
- 发布:2021-09-02 11:57
- 更新:2021-09-03 10:25
- 阅读:1269
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 11.5.2
HBuilderX类型: 正式
HBuilderX版本号: 3.2.2
手机系统: iOS
手机系统版本号: IOS 14
手机厂商: 苹果
手机机型: Apple iPhone 11
页面类型: vue
打包方式: 离线
项目创建方式: HBuilderX
示例代码:
操作步骤:
本地xcode,卸载安装换另一台真机都可以成功拉取授权;为保证非服务端问题,特意做了一个拿到授权成功信息后直接返回到其他页面的版本,审核依然提示Could not connect
本地xcode,卸载安装换另一台真机都可以成功拉取授权;为保证非服务端问题,特意做了一个拿到授权成功信息后直接返回到其他页面的版本,审核依然提示Could not connect
预期结果:
可正常授权
可正常授权
实际结果:
提交苹果审核,审核提示点击Sign in with apple时,提示Could not connect报错;
提交苹果审核,审核提示点击Sign in with apple时,提示Could not connect报错;
bug描述:
基本环境代码描述
- 使用HBuilderX3.2.2以及对应版本的离线sdk;
- 苹果证书已开启Sign in with apple;
- 本地xcode真机没有问题,可正常授权;
- 确认网络权限已开启(做过网络监测,若是没有给予网络权限将不能进入app,此问题可排除);
- 确认不是获取到用户信息后服务端返回字段;
- xcode版本:Version 12.5.1 (12E507)
- 非企业开发者证书;