将GoogleSignIn Auth Token保存到Keychain Swift 4

时间:2018-04-10 16:26:36

标签: swift google-api google-signin

Google针对IOS的Gmail API文档很糟糕,他们的GitHub示例未更新为swift。

我目前已在我的应用程序中成功实施了Google登录。但是,当用户打开应用程序时,我正在运行GIDSignIn.sharedInstance().signInSilently()以确保用户仍然已登录。

我一直收到此错误:

Error Domain=com.google.GIDSignIn Code=-4 "(null)"

以下是他们的文件说:

Indicates there are no auth tokens in the keychain. This error code 
will be returned by *signInSilently* if the user has never signed in 
before with the given scopes, or if they have since signed out.

如何将身份验证令牌添加到钥匙串中,以免发生此错误?

0 个答案:

没有答案