gpt4 book ai didi

ios - Flutter 登录苹果失败

转载 作者:行者123 更新时间:2023-12-01 19:35:50 30 4
gpt4 key购买 nike

我在我的应用程序上实现了使用苹果登录,由于某种原因,我的服务器返回错误导致使用苹果登录的用户名长度不符合我的条件,并且我没有缓存用户的信息。之后我更新服务器以删除用户名长度要求,但不幸的是用户名和电子邮件为空?我知道的解决方案是在 Iphone 上的设置页面中停止使用 Apple id,还有其他代码解决方案吗?这是我的代码:

AppleSignInButton(
style: ButtonStyle.whiteOutline,
cornerRadius: 8,
type: ButtonType.signIn,
onPressed: () async {
var isConnected = await checkConnection();
if (!isConnected) {
showErrorDialog(message: ErrorMessage.NO_NETWORK);
} else {
final AuthorizationResult result = await AppleSignIn.performRequests([
AppleIdRequest(requestedScopes: [Scope.email, Scope.fullName])
]);

if (result != null) {
switch (result.status) {
case AuthorizationStatus.authorized:
_loginWithApple(result.credential);
break;
case AuthorizationStatus.cancelled:
break;
case AuthorizationStatus.error:
showErrorDialog(message: result.error.localizedFailureReason);
break;
}
} else {
showErrorDialog(message: result.status.toString(), onTap: (){});
}
}
},)

最佳答案

显然 Apple 提供了 fullNameemail仅限首次登录的字段。这些字段将是 null用于后续登录。
但是,您可以选择通过 appleIDCredential.fullName 获取全名在 didCompleteWithAuthorization委托(delegate)方法,并自己更新用户的个人资料。
来源:https://github.com/firebase/firebase-ios-sdk/issues/4393#issuecomment-559012512

关于ios - Flutter 登录苹果失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60203590/

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