Sign In With Apple
Sign in with Apple makes it easy for users to sign in to your apps and websites using their Apple ID. Instead of filling out forms, verifying email addresses, and choosing new passwords, they can use Sign in with Apple to set up an account and start using your app right away. All accounts are protected with two-factor authentication for superior security, and Apple will not track usersβ activity in your app or website. Source: https://developer.apple.com/sign-in-with-apple/
https://github.com/twogate/cordova-plugin-sign-in-with-apple
Stuck on a Cordova issue?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionicβs experts offer premium advisory services for both community plugins and premier plugins.
Installation
- Capacitor
- Cordova
- Enterprise
$ npm install cordova-plugin-sign-in-with-apple
$ npm install @awesome-cordova-plugins/sign-in-with-apple
$ ionic cap sync
$ ionic cordova plugin add cordova-plugin-sign-in-with-apple
$ npm install @awesome-cordova-plugins/sign-in-with-apple
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Β Learn More or if you're interested in an enterprise version of this plugin Contact Us
Supported Platforms
- iOS
Usage
React
Learn more about using Ionic Native components in React
Angular
import { SignInWithApple, AppleSignInResponse, AppleSignInErrorResponse, ASAuthorizationAppleIDRequest } from '@awesome-cordova-plugins/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);
});