uni-app 苹果登录

 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
			    });
			}
	});

技术文档:https://ask.dcloud.net.cn/article/36651

发布了195 篇原创文章 · 获赞 526 · 访问量 76万+

猜你喜欢

转载自blog.csdn.net/Bright2017/article/details/105728742