且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 React Native 中使用 Apple 登录返回 null

更新时间:2022-06-08 07:18:51

使用 Apple 登录,您只会在首次登录时获得电子邮件/姓名.然后您有责任存储该信息.来源:

With Sign in with Apple, you only get the email/name on first login. It's your responsibility to then store that information. Source:

只有当用户第一次通过您的应用使用 Apple 登录时,身份验证服务器才会返回用户状态.后续尝试不会返回此用户状态的任何信息,例如在断开连接和重新连接后或从其他设备返回.

The identification servers return the user status only when the user first uses Sign in with Apple with your app. Subsequent attempts don’t return any information for this user status, such as after a disconnect and reconnect occurs or from other devices.

https://developer.apple.com/documentation/sign_in_with_apple/sign_in_api/in_apple_rest_api/authenticating_users_with_sign_in_with_apple

另外:https://developer.apple.com/forums/thread/121496一个>

就注销而言,您不必一定通过使用 Apple 登录来执行此操作.如果您将凭据存储在设备上,则应从存储它们的任何位置清除它们.此外,如果您将凭据用于其他服务(如 Firebase),您当然可以退出该服务.

In terms of logging out, you don't necessarily do this with Sign in With Apple. If you're storing credentials on the device, you should purge them from wherever they're being stored. Also, if you're using the credentials for another service (like Firebase), you can certainly log out of that service.

你没有说你为此使用了什么库,但如果它是re​​act-native-apple-authentication,你可能想参考这个关于注销行为的线程:https://github.com/invertase/react-native-apple-authentication/issues/10#issuecomment-611532131

You don't say what library you're using for this, but if it's react-native-apple-authentication, you may want to refer to this thread about logout behavior: https://github.com/invertase/react-native-apple-authentication/issues/10#issuecomment-611532131

如果在 iOS 设备上,用户可以通过设置"应用撤销使用 Apple 登录"访问权限.另请参阅此相关 SO 问题:从 Apple-Sign In 注销

If on an iOS device, the user can revoke Sign In With Apple access via the Settings app. See also this related SO question: Logout from Apple-Sign In