无法获取名称&在真实设备上与Apple一起登录并发送电子邮件 [英] Cannot get name & email with sign in with Apple on real device

查看:243
本文介绍了无法获取名称&在真实设备上与Apple一起登录并发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在使用Apple实施登录,模拟器上的所有操作均正常进行,我请求发送电子邮件,fullName范围,身份验证UI显示,并且我可以获取数据,如下图所示:

So I'm implementing sign in with Apple, everything goes well on the simulator, I request email, fullName scopes, the authenticate UI shows, and I can get the data, as images shown below:

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

But when testing on real device (iPadOS 13, iPad 2018), the UI didn't show (it does not asks for name and email on the UI), and I can't get the email, fullName from the response, and I can also confirm that the authorizedScopes are empty, I can only get the user identifier

我相信这是一个错误,并且会引起人们的注意,并在Apple开发人员论坛上发布了讨论(但他们通常不会批准我的帖子,我不知道为什么)

I believe this is a bug and will file a radar, also posted a discussion on the Apple developer forum (but they usually won't approve my post, I don't know why)

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

If this is not a bug, can somebody tell me how to fix this? Thanks

推荐答案

问题已解决! tl; dr

Problem solved! tl;dr

这是预期的行为

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

Answered by Apple Engineer (Original post link: https://forums.developer.apple.com/thread/121496)

嗨aslkdjalksdjasdasd,

Hi aslkdjalksdjasdasd,

这是正确的行为,仅在初始用户注册后,才在ASAuthorizationAppleIDCredential中发送用户信息.随后的 使用具有相同帐户的Apple登录使用您的应用程序登录 不分享任何用户信息,并且只会在 ASAuthorizationAppleIDCredential.建议您安全 缓存包含用户的初始ASAuthorizationAppleIDCredential 信息,直到您可以验证帐户已成功 在您的服务器上创建.

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.

帕特里克

2019/12/15编辑

此行为也记录在Apple的使用Apple登录"文档中,请检查文档

确保您的应用将凭据和用户信息中继到应用服务器. API会收集此信息,并在用户首次使用使用Apple登录"登录应用程序时与您的应用程序共享 .如果用户随后在另一台设备上使用通过Apple登录",则API不会再询问用户名或电子邮件.仅当用户停止使用Apple登录并稍后重新连接到您的应用时,它才会再次收集信息.

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.

这篇关于无法获取名称&在真实设备上与Apple一起登录并发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆