Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Firebase: How to get email from sign in with apple on real device?

$
0
0

I'm implementing a sign in with apple, this is my code on apple button press

  onAppleButtonPress = async () => {// performs login requestconst appleAuthRequestResponse = await appleAuth.performRequest({  requestedOperation: AppleAuthRequestOperation.LOGIN,  requestedScopes: [    AppleAuthRequestScope.EMAIL,    AppleAuthRequestScope.FULL_NAME,  ],});// Ensure Apple returned a user identityTokenif (!appleAuthRequestResponse.identityToken) {  console.log('no token');  throw 'Apple Sign-In failed - no identify token returned';}// Create a Firebase credential from the responseconst {identityToken, nonce} = appleAuthRequestResponse;const appleCredential = firebaseAuth.AppleAuthProvider.credential(  identityToken,  nonce,);//I WANT TO GET THE EMAIL HERE TO USE CHECK IT FROM FIREBASE IF EMAIL ALREADY EXISTS BY THIS CODEfirebaseAuth()        .fetchSignInMethodsForEmail(appleAuthRequestResponse.email)        .then(providers => {});}

It works on the simulator, but on real device the email is null.Anyone who can help?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>