23

I'm implementing sign in with Google plus. The implementation is basically copied from examples from Developer Google. When I login for the first time all works fine. But if I then logout using

 [[GIDSignIn sharedInstance] signOut];

next time I login in I get the

Error Domain=com.google.GIDSignIn Code=-2 "keychain error"

Please advice what can be done in this situation. Thanks

zshcbka
  • 416
  • 3
  • 14

3 Answers3

12

I'm having the same issue here. After doing some tests, i've noticed that if i run my app without the debugger (Build, stop, run app) everything works as expected...try it

gafos
  • 197
  • 2
  • 9
2

Probably a long shot, but try calling disconnect on the sharedInstance?

- (void)signOut {
    [[GIDSignIn sharedInstance] disconnect];
}
Amy
  • 301
  • 2
  • 9
2

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

Subhojit Mandal
  • 450
  • 4
  • 13
  • This is a reference to http://stackoverflow.com/questions/38812761/gidsignin-keychain-error-ios-10-xcode-8/38818137#38818137 – Rayfleck Oct 14 '16 at 01:33
  • Keychain was enabled already in Capabilities. Please, see the gafos' answer. – zshcbka Oct 17 '16 at 11:39