Sign In with apple for ionic 4

Please, help me find a solution for Sign In with apple for ionic 4. I tried`

I found the solution

import { SignInWithApple, AppleSignInResponse, AppleSignInErrorResponse, ASAuthorizationAppleIDRequest } from ‘@ionic-native/sign-in-with-apple/ngx’;

constructor(private signInWithApple: SignInWithApple) { }

this.signInWithApple.signin({
  requestedScopes: [
    ASAuthorizationAppleIDRequest.ASAuthorizationScopeFullName,
    ASAuthorizationAppleIDRequest.ASAuthorizationScopeEmail
  ]
})
.then((res: AppleSignInResponse) => {
  // https://developer.apple.com/documentation/signinwithapplerestapi/verifying_a_user
  alert('Send token to apple for verification: ' + res.identityToken);
  console.log(res);
})
.catch((error: AppleSignInErrorResponse) => {
  alert(error.code + ' ' + error.localizedDescription);
  console.error(error);
});
1 Like

Does anyone know how to logout after you sign in with apple