我实现登入Google+ iOS中,我用这个代码,它工作正常trySilentAuthentication没有Google+按钮
signIn = [GPPSignIn sharedInstance];
signIn.delegate = self;
//signIn.shouldFetchGoogleUserEmail = YES;
signIn.shouldFetchGooglePlusUser = YES;
signIn.clientID = kClientId;
signIn.scopes = [NSArray arrayWithObjects:kGTLAuthScopePlusLogin,nil];
signIn.actions = [NSArray arrayWithObjects:@"http://schemas.google.com/ListenActivity",nil];
[signIn authenticate];
我想用[签到trySilentAuthentication]方法不留起来,每次用户登录在但是它并没有使用谷歌+按钮GPPSignInButton
所以工作时,有什么不好使用此代码,而不是上面
signIn = [GPPSignIn sharedInstance];
signIn.delegate = self;
//signIn.shouldFetchGoogleUserEmail = YES;
signIn.shouldFetchGooglePlusUser = YES;
signIn.clientID = kClientId;
signIn.scopes = [NSArray arrayWithObjects:kGTLAuthScopePlusLogin,nil];
signIn.actions = [NSArray arrayWithObjects:@"http://schemas.google.com/ListenActivity",nil];
[signIn trySilentAuthentication];
的一个是它POSS能使用didSelectRowAtIndexPath使用trySilentAuthentication吗? 在此先感谢
通过拆分代码,这将使用户始终登录,而我有其他选项,我希望他选择。我编辑我的代码与我尝试的,这两个代码在didSelectRow尝试.. – Twinkle
为什么你想要让用户选择,如果他们已经登录?如果您希望它们能够连接多个帐户,或者如果您希望它们能够切换帐户,您仍然可以向他们显示选项列表,您应该使用signOut方法,这也会阻止trySilentAuthentication触发。 –
已更新的答案,以澄清trySilentAuthentication的目标是什么。 –