小编Noe*_*lon的帖子

Firebase:如何在真实设备上使用Apple登录获取电子邮件?

我正在使用苹果实现登录,这是我在按下苹果按钮时的代码

  onAppleButtonPress = async () => {
// performs login request
const appleAuthRequestResponse = await appleAuth.performRequest({
  requestedOperation: AppleAuthRequestOperation.LOGIN,
  requestedScopes: [
    AppleAuthRequestScope.EMAIL,
    AppleAuthRequestScope.FULL_NAME,
  ],
});

// Ensure Apple returned a user identityToken
if (!appleAuthRequestResponse.identityToken) {
  console.log('no token');
  throw 'Apple Sign-In failed - no identify token returned';
}

// Create a Firebase credential from the response
const {identityToken, nonce} = appleAuthRequestResponse;
const appleCredential = firebaseAuth.AppleAuthProvider.credential(
  identityToken,
  nonce,
);


//I WANT TO GET THE EMAIL HERE TO USE CHECK IT FROM FIREBASE IF …
Run Code Online (Sandbox Code Playgroud)

ios react-native firebase-authentication sign-in-with-apple

3
推荐指数
1
解决办法
3012
查看次数