invertase / invertase/react-native-apple-authentication

After Revoking Apple ID (Stop Using Apple ID) not getting full name and email on next login attempt

Open
#340 25 comments 25 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.7k
Forks
236
PR merge metrics
No merged PRs in 30d

Description

The [FAQs](https://github.com/invertase/react-native-apple-authentication?tab=readme-ov-file#faqs) say that in order to receive the full name and email again, you must revoke Apple ID access for the app. After logging out of the app, revoking Apple ID access (Settings > Apple ID > Sign-In & Security > Sign in with apple > My App > Stop Using Apple ID), and then logging in again, I'm still not seeing full name and email in the response. I was also expecting to be prompted to share/ hide my email address but that didn't pop up either.

Here is the code:
```
async function signInOrRegisterWithApple() {
const appleAuthRequestResponse = await appleAuth.performRequest({
requestedOperation: appleAuth.Operation.LOGIN,
requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL],
});

const { identityToken, nonce, email, fullName } = appleAuthRequestResponse;

if (identityToken) {
const appleCredential = firebase.auth.AppleAuthProvider.credential(identityToken, nonce);

const user = await firebase.auth().signInWithCredential(appleCredential);

console.warn(`These values are empty: ${email} ${fullName?.givenName}`);
}
}
```

Other things I've tried:
1. Made sure the order of requestedScopes had Full name first
2. Uninstalled the app and reinstalled + revoke Apple ID access while uninstalled
3. Posted in [Apple Community](https://discussions.apple.com/thread/255421975)
4. I've tried to revoke the token, at first I was getting`[Error: [auth/invalid-credential] The supplied auth credential is malformed or has expired.]` but realized this was because I was using firebase local auth emulator. After switching to the hosted firebase auth, revokeToken did work successfully, however, the main problem still persists.

```
async function revokeSignInWithAppleToken() {
const { authorizationCode } = await appleAuth.performRequest({
requestedOperation: appleAuth.Operation.REFRESH,
});

if (!authorizationCode) {
throw new Error("Apple Revocation failed - no authorizationCode returned");
}

// Revoke the token
return auth().revokeToken(authorizationCode);
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.