我遇到了一个与此类似的问题。基本上每次我的应用程序启动时,我都必须使用我的 Google 帐户登录。
然后,我有这个属性:
var isGoogleSessionOpen: Bool {
return GIDSignIn.sharedInstance().currentUser != nil
}
一旦应用程序开始检查我是否必须显示 LoginViewController,就会调用它。
我的问题是这个调用总是首先为零,所以每次我的应用程序启动时我都必须登录。
另外,正如这里提到的,我正在配置这样的范围:
if let signIn = GIDSignIn.sharedInstance() {
signIn.scopes = ["https://www.googleapis.com/auth/plus.login","https://www.googleapis.com/auth/plus.me"]
}
有什么想法吗?
问候