拜托,你能帮我吗?我想添加使用ionic 4登录,但没有文档,我只找到了这个https://www.npmjs.com/package/cordova-plugin-sign-in-with-apple,但是我无法使用。
非常感谢
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);
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句