appleAuthRequestResponse 对于 fullName 和 email 返回 null

STB*_*Box 1 authentication react-native

我很困惑为什么在用户成功通过身份验证后,下面的代码片段在控制台中显示电子邮件和全名为空。我仔细阅读了文档并尝试了一切可能的方法。任何帮助将不胜感激。

async function onAppleButtonPress() {
    // performs login request
    const appleAuthRequestResponse = await appleAuth.performRequest({
      requestedOperation: AppleAuthRequestOperation.LOGIN,
      requestedScopes: [AppleAuthRequestScope.EMAIL, AppleAuthRequestScope.FULL_NAME],
    });
    //api getting current state of the user
    const credentialState = await appleAuth.getCredentialStateForUser(appleAuthRequestResponse.user);
    
    if (credentialState === AppleAuthCredentialState.AUTHORIZED) {
      // user is authenticated
      console.log("email is",appleAuthRequestResponse.email);
      console.log("full name is",appleAuthRequestResponse.fullName);
    }  
  }
Run Code Online (Sandbox Code Playgroud)

yem*_*emd 5

appleAuthrequestResponse您仍然可以使用任何 jwt 解码器(如jwt-decode)提供的 IdentityToken 检索电子邮件

    const {identityToken, nonce, email} = appleAuthRequestResponse
    const {email} = jwt_decode(identityToken)
    console.log(email)
Run Code Online (Sandbox Code Playgroud)