应用在 G+ 登录时崩溃。
Crashlytics 报告它发生在方法中:
[GPPSignIn addSavedKeychainName:]
异常(exception)是:
Fatal Exception: NSInvalidArgumentException
[___NSArrayM insertObject:AtIndex:]: object cannot be nil
我的代码是:
- (void)googleLogin
{
GPPSignIn *gppSignIn = [GPPSignIn sharedInstance];
gppSignIn.clientID = GOOGLE_CLIENTID;
gppSignIn.scopes = [NSArray arrayWithObjects:kGTLAuthScopePlusLogin, nil];
gppSignIn.delegate = self;
gppSignIn.shouldFetchGoogleUserEmail = YES;
gppSignIn.attemptSSO = YES;
[SVProgressHUD show];
[gppSignIn authenticate];
}
有没有其他人遇到过这个问题并且知道如何解决它?
最佳答案
这可能是你调用
造成的[gppSignIn authenticate];
相反,尝试:
[gppSignIn trySilentAuthentication];
如果您希望用户自动登录。
您可能还想尝试将范围作为字符串常量传递,以确保 kGTLAuthScopePlusLogin
值没有发生某些事情:
signIn.scopes = [NSArray arrayWithObjects:
@"login",
nil];
另请注意,当达到此状态时将用户注销可能会解决问题:
[[GPPSignIn sharedInstance] signOut];
关于ios - Google+ 登录崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23731100/