gpt4 book ai didi

react-native - 世博苹果登录 react 原生返回空值

转载 作者:行者123 更新时间:2023-12-04 08:43:42 31 4
gpt4 key购买 nike

我已经在我的 native 应用程序中实现了苹果登录。有时它起作用有时不起作用。
当它不工作时,它返回所有空用户值,如下所示:

{
"authorizationCode": "123456789omitted",
"email": null,
"fullName": Object {
"familyName": null,
"givenName": null,
"middleName": null,
"namePrefix": null,
"nameSuffix": null,
"nickname": null,
},
"identityToken": "987654321omitted",
"realUserStatus": 1,
"state": null,
"user": "192837465omitted",
}
为什么会发生这种情况?
<AppleAuthentication.AppleAuthenticationButton
buttonType={AppleAuthentication.AppleAuthenticationButtonType.SIGN_IN}
buttonStyle={AppleAuthentication.AppleAuthenticationButtonStyle.BLACK}
cornerRadius={5}
style={{
width: Constant.width * 0.92,
height: 44,
}}
onPress={async () => {
try {
setAppleLoggingIn(true);
const credential = await AppleAuthentication.signInAsync({
requestedScopes: [
AppleAuthentication.AppleAuthenticationScope.FULL_NAME,
AppleAuthentication.AppleAuthenticationScope.EMAIL,
],
});
// signed in
onSignIn(credential);//signs in user via firebase
setAppleLoggingIn(false);
} catch (e) {
if (e.code === "ERR_CANCELED") {
// handle that the user canceled the sign-in flow
setAppleLoggingIn(false);
return {cancelled: true};
} else {
// handle other errors
setAppleLoggingIn(false);
return {error: true};
}
}
}}
/>
我认为这与这个问题有关,但我从未阻止该应用程序访问我的 Apple id...当它请求权限时,我总是“接受”。 Getting email id value null as response during apple-authentication

最佳答案

Apple Sign In 仅在第一次登录(注册)时发送用户信息。之后,由您来存储它们并在用户再次登录时重新使用它们。

关于react-native - 世博苹果登录 react 原生返回空值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64436462/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com