gpt4 book ai didi

ionic-framework - Ionic 4 使用 Apple 登录

转载 作者:行者123 更新时间:2023-12-04 00:21:59 24 4
gpt4 key购买 nike

拜托,你能帮帮我吗?我想添加 Sign in with 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);
});

关于ionic-framework - Ionic 4 使用 Apple 登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59787138/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com