最近了解了iOS 13新增功能之Sign In with Apple,Sign In with Apple是跨平台的,可以支持iOS、macOS、watchOS、tvOS、JS。本文主要内容为Sign In with Apple在iOS上的基础使用。详情参考WWDC 2019
- 审核备注
New Guidelines for Sign in with Apple
We’ve updated the App Store Review Guidelines to provide criteria for when apps are required to use Sign in with Apple. Starting today, new apps submitted to the App Store must follow these guidelines. Existing apps and app updates must follow them by April 2020. We’ve also provided new guidelines for using Sign in with Apple on the web and other platforms.
September 12, 2019
也就是说,所有已接入其它第三方登录的 App,Sign In with Apple 将被要求作为一种登录选择,否则就不给过。从今天开始(2019-9-12),提交到App Store的新应用必须遵循这些准则,现有应用程序和应用程序更新必须在2020年4月之前进行。详情参考App Store审核指南

- 开发
Sign In with Apple的注意事项
需要在苹果后台打开该选项,并且重新生成Profiles配置文件,并安装到Xcode,如下图

- 服务端验证需要的文件,一个是私钥文件,一个是
config.json文件 - 创建用于客户端身份验证的私钥
返回Certificates, Identifiers & Profiles主屏幕,从侧面导航中选择Keys

单击Configure按钮,然后选择你先前创建的Primary App ID,保存之后,Apple将为你生成一个新的私钥,并让你仅下载一次,请确保你保存了此文件,因为以后你将无法再次将其取回!你下载的文件将以.p8结尾,可以将其重命名为key.txt以便在后续步骤中更轻松地使用
- 创建
config.json新文件,格式、内容和参数说明如下
{
"client_id": "实际上被称为“Service ID”,您将在“Identifiers”部分创建它,其实就是应用的bundleID",
"team_id": "后台账号的teamID",
"redirect_uri": "重定向url,网页登录需要,只是客服端登录可以不写",
"key_id": "在苹果后台获取,如下图",
"scope": "设置我们要从用户那里收集什么信息,我们可以设置email和name,或者也可以不写
}

web使用Sign In with Apple的相关配置,不需要web登录的,以下配置可以忽略- 创建
Services ID

在下一步中,你将定义用户在登录流程中将看到的应用程序的名称,并定义成为OAuth的标识符client_id,确保还选中Sign In with Apple复选框

- 创建
web Authentication Configuration,定义应用程序的重定向URL

本文介绍了iOS 13中引入的Sign In with Apple功能,详细阐述了App Store的新审核指南,要求新应用必须提供此登录选项。开发者需要注意配置Apple ID服务、生成私钥和配置文件,并提供了授权码获取、验证流程及注意事项。同时,文章提到了已使用登录过的用户处理方式以及服务端验证的重要性。
最低0.47元/天 解锁文章
1187

被折叠的 条评论
为什么被折叠?



