GIDSignIn 钥匙串错误 iOS 10 Xcode 8

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38812761/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:07:24  来源:igfitidea点击:

GIDSignIn keychain error iOS 10 Xcode 8

xcodekeychainios10gidsigninxcode8-beta4

提问by RyanTCB

In iOS 10 and xcode 8 when I try to sign in to google services I get "keychain error"

在 iOS 10 和 xcode 8 中,当我尝试登录 Google 服务时出现“钥匙串错误”

 func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!){
        if error != nil {
            print("\(error!.localizedDescription)")
}
}

Offered and accepted solutions on SO are to run the app direct from simulator and not via Xcode. This I have tried and have had no success hence posting this question here in the hope someone has a more recent solution or experience.

在 SO 上提供和接受的解决方案是直接从模拟器运行应用程序,而不是通过 Xcode。我已经尝试过但没有成功,因此在这里发布这个问题,希望有人有更新的解决方案或经验。

回答by Roman Ermolov

The problem you are trying to solve is connected with keychain access. To fix issue you simply should go to Target->Capabilities and enable keychain sharing. Similar case with Facebook SDK is desribed here.

您尝试解决的问题与钥匙串访问有关。要解决问题,您只需转到 Target->Capabilities 并启用钥匙串共享。此处描述了与 Facebook SDK 类似的案例。

If you are using Xamarin(read this linkfor more information, thanks @dynamokaj):

如果您使用的是Xamarin(阅读此链接了解更多信息,感谢 @dynamokaj):

Just make sure you enable the keychain access in Entitlements and select the entitlements for Simulator (Debug) builds too. By default this is not set.

只需确保在权利中启用钥匙串访问,并选择模拟器(调试)构建的权利。默认情况下未设置。