ios - 在真实设备上使用 Apple 登录无法获取姓名和电子邮件

标签 ios xcode applet ios13

所以我正在使用 Apple 实现登录,在模拟器上一切顺利,我请求电子邮件、fullName 范围、验证 UI 显示,并且我可以获取数据,如下图所示:

enter image description here enter image description here

但是在真实设备(iPadOS 13、iPad 2018)上测试时,UI 没有显示(它不要求在 UI 上输入姓名和电子邮件),而且我无法从响应中获取电子邮件、全名, 而且我也可以确认 authorizedScopes 是空的,我只能得到用户标识符

enter image description here enter image description here

我认为这是一个错误,将提交雷达,还在 Apple 开发者论坛上发表了讨论(但他们通常不会批准我的帖子,我不知道为什么)

如果这不是错误,有人可以告诉我如何解决这个问题吗? 谢谢

最佳答案

问题解决了!长话短说

这是预期的行为

由 Apple 工程师回答 (原帖链接:https://forums.developer.apple.com/thread/121496)

Hi aslkdjalksdjasdasd,

This behaves correctly, user info is only sent in the ASAuthorizationAppleIDCredential upon initial user sign up. Subsequent logins to your app using Sign In with Apple with the same account do not share any user info and will only return a user identifier in the ASAuthorizationAppleIDCredential. It is recommened that you securely cache the initial ASAuthorizationAppleIDCredential containing the user info until you can validate that an account has succesfully been created on your server.

Patrick

2019/12/15 编辑

此行为也记录在 Apple 的 Sign in with Apple 文档中,请查看 documentation .

Ensure that your app relays the credentials and user information to your app servers. The API collects this information and shares it with your app the first time the user logs in to the app using Sign in with Apple. If the user then uses Sign in with Apple on another device, the API doesn't ask for the user’s name or email again. It collects the information again only if the user stops using Sign in with Apple and later reconnects to your app.

关于ios - 在真实设备上使用 Apple 登录无法获取姓名和电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57545635/

相关文章:

ios - UINavigationController 向下滑动手势检测

ios - 如何在 Objective-C 中找到平均 10 个信号强度记录

ios - Xcode 8.1 和 unwind segues 有问题

iphone - 当应用程序在ios中显示默认图像时如何隐藏状态栏?

ios - SwiftUI:选取器中的 ForEach 不更新

objective-c - 使用[ self 类]有什么意义

iOS:如何在矩形内创建按钮?

java - 尝试与父类中的对象共享套接字

java - 使用 Java Applet 用箭头键移动球

java - 使用 Java 8 自签名证书