真机Apple登录报错Code 1000,模拟器运行正常
在iPhone 14真机上执行Apple登录时触发错误:com.apple.AuthenticationServices.Authorization Error Code 1000,但在模拟器中可以正常运行。开发环境为React Native + Expo Go,已尝试以下解决方案:
- 在Xcode中添加登录权限并重启应用
- 从iCloud移除其他设备后重新构建项目
- 在Expo配置文件
app.config.js中添加usesAppleSignIn配置,代码如下:
ios: { googleServicesFile: "./GoogleService-Info.plist", supportsTablet: true, bundleIdentifier: "com.dadyzal", buildNumber: "7.0.9", usesAppleSignIn: true },
- 在Xcode中配置开发团队
怀疑是否因缺少Entitlements文件导致该问题?以下是Apple登录相关业务代码:
async function onAppleButtonPress() { try { console.log("开始发起Apple登录请求..."); // 执行登录请求 const appleAuthRequestResponse = await appleAuth.performRequest({ requestedOperation: appleAuth.Operation.LOGIN, requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL], }); console.log("已收到Apple返回的响应。"); console.log(appleAuthRequestResponse); const appleCredential = auth.AppleAuthProvider.credential( appleAuthRequestResponse.identityToken, appleAuthRequestResponse.nonce ); await auth().signInWithCredential(appleCredential); // 导航至首页 navigation.navigate('Home' as never); // } else { // console.log("用户未完成认证。"); // } } catch (error) { console.error("Apple登录过程出错:", error); setError(error.message); } }
内容的提问来源于stack exchange,提问作者edjav
相关产品推荐
相关产品推荐

