aboutyou / dart_packages

Dart and Flutter plugins maintained and used by @ABOUTYOU
222 stars 152 forks source link

SignInWithApple.getAppleIDCredential won't return values after second calls. #449

Closed ChurikiTenna closed 1 week ago

ChurikiTenna commented 1 week ago

I am testing sign_in_with_apple like this.

final credential = await SignInWithApple.getAppleIDCredential(
      scopes: [
        AppleIDAuthorizationScopes.email,
        AppleIDAuthorizationScopes.fullName,
      ],
    );
    print('credential ${credential.email}');

SignInWithApple.getAppleIDCredential returned correct email first, however, it wont return any values after second call.

What happen if users Sign in with Apple, then sign out, then Sign in with Apple again?

I did not find sign out feature in the package, Does that mean users should not sign out from the app ever?

tp commented 1 week ago

Not getting the name and/or e-mail upon subsequent logins is correct and by design. Please see the plethora of previous issues around this topic.

You'll have to store any information you want to retain on your server.

Does that mean users should not sign out from the app ever?

That depends on what you want to do. Do you want to allow the user to sign out and sign into the account with a different account (e.g. an e-mail backed one, or Google Sign-In etc.), then you can implement that locally in your app.

From the Sign in with Apple side, the user may sever the relation between their account and your app via the iCloud settings. But this is more of an "unregister" or at least "remove this login method from my account" and not a logout on a single platform.

So overall it seems like you're missing the server component that would store the user's basic data, handle the session management in your system (as opposed to the account management from Apple's side), and be able to handle those "unregister" calls (which Apple will sent you via a webhook).