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);
});
4 Likes

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

I am getting this error

HomePage.html:10 ERROR TypeError: Object(…) is not a function
at SignInWithApple.signin (vendor.js:80215)

Any solution for this?

Did you find logout solution?

no, still looking for it. if u found a solution please let me know

AngularFireAuth logout function works well:

this.afAuth.auth.signOut();

Do we need more? :confused:

Hi, there’s a nice tutorial in medium, I followed it and it worked like a charm

There is also one for the app, not only for web