No user info when using SignInWithApple

37 Views Asked by At

I have a flutter iOS app to which I added signin with apple using the package sign_in_with_apple. I configured everything right everywhere but for some reason calling SignInWithApple.getAppleIDCredential doesn't return user info. Here's my code :

final rawNonce = generateNonce();
final nonce = sha256ofString(rawNonce);
final appleCredential = await SignInWithApple.getAppleIDCredential(
  scopes: [
    AppleIDAuthorizationScopes.email,
    AppleIDAuthorizationScopes.fullName,
  ],
  nonce: nonce,
);

when I check the appleCredential variable it doesn't contain the user email, but it does contain the autorization code and the identity token. I use the same signin with apple on another app, a web app and there the identity token when decode it, it contains the email claim but on flutter the identity token doesn't have it. Not sure what I'm missing here.

1

There are 1 best solutions below

0
Cam Hoang On

Sign in with Apple, by the way, only returns the user's email once, and that happens the first time only if the user agrees to share it with your app (a popup will appear).

To make the popup show again, go to Settings -> Apple ID -> Password & Security -> Sign in with Apple -> (Your app) -> Stop using Apple ID. Then try again.