This has proved highly unreliable on iOS and we currently don't recommend using this process. It seems to commonly return an error even though everything seems correct. We are waiting for feedback / updates from Apple on this
Instead we recommend implementing a server to perform authentication checks using the auth code / tokens.
You can check the user credential state by calling the
getCredentialStateForUser() and passing the "user" received when authentication succeeded.
Note: This is supported on iOS only
The user value is the
AppleIdCredential.user property and you should store this value as an identifier for your user.
getCredentialStateForUser() will dispatch one of two events:
AppleSignInEvent.GET_CREDENTIAL_STATE_SUCCESS: If the credential state was successfully ;
AppleSignInErrorEvent.GET_CREDENTIAL_STATE_ERROR: If an error occurred;
The value of the
state property in the returned event will be one of the
AppleIDCredentialState defined values:
AppleIDCredentialState.REVOKED: The user ID was revoked by the user;
AppleIDCredentialState.AUTHORIZED: The user ID is in good state;
AppleIDCredentialState.NOT_FOUND: The user ID was not found;