GIDSignIn keychain error iOS 10 Xcode 8

2020-08-09 11:37发布

问题:

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

 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.

回答1:

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.

If you are using Xamarin (read this link for more information, thanks @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.