iOS13+ 系统开始支持苹果登录,需要在登录界面进行判断,是否ios,如果是,需要添加苹果登录
苹果登录示例
uni.login({
provider: 'apple',
success: function(loginRes) {
let iosopenid=loginRes.authResult.openid
// 获取用户信息
uni.getUserInfo({
provider: 'apple',
success() {
//在这里获取到苹果手机的ID后可以继续你的操作,请求后台进行登录
}
});
},
fail: function(err) {
uni.showToast({
icon: 'none',
title: err,
duration: 2000
});
}
});