美文网首页iOS开发
苹果登录 Sign in with Apple

苹果登录 Sign in with Apple

作者: 丁勾J | 来源:发表于2019-08-26 16:25 被阅读0次

摘要
1.Xcode配置和软件支持;
2.UI要求
3.功能流程
4.业务注意
参考文档:https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/
https://developer.apple.com/documentation/authenticationservices

1.Xcode配置和软件支持

手机软件支持:iOS13.0;
Xcode版本:Xcode-Beta 11.0 及其以上版本;
证书:需创建支持苹果登录的证书;
Xcode-TARGETS-Signing&Capabilities中添加Sign in with Apple选项


Xcode添加项.png

2.UI的要求

1.登录按钮样式
要求:白色、白色加边框、黑色。
示范如下:


登录按钮-三种样式.png

2.按钮大小和位置
要求:a.和其他登录按钮尺寸一样;
b.出现在第一屏(避免滑动屏幕才看到);
c.圆角范围及按钮最小尺寸


登录按钮-圆角范围.png
登录按钮-最小尺寸.png

3.功能能流程

苹果登录-流程.png
1.ASAuthorizationAppleIDButton 创建登录按钮.png
2.Button --> Authorization 授权.png
3.显示授权页面(ASAuthorizationControllerPresentationContextProviding)
授权页面UI代理.png
4.Verification (授权代理ASAuthorizationControllerDelegate,在这个代理方法里做校验) 授权代理.png
5.Handing Changes(a.app停止使用AppleID;b.设备退出苹果账号)
苹果账号状态改变.png

4.业务注意

通过监听系统消息ASAuthorizationAppleIDProviderCredentialRevoked 处理登录登出状况
登录的两种方法:ASAuthorizationAppleIDRequest和ASAuthorizationPasswordRequest

相关文章

网友评论

    本文标题:苹果登录 Sign in with Apple

    本文链接:https://www.haomeiwen.com/subject/ddiusctx.html