从谷歌退出加我使用断开连接方法,但之后登录应用程序直接进入权限页面。不要求登录。为什么呢?
here is my Sign In function
-(google*) MethodgoogleLogin
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"gotGoogleErrorAppClosed" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(gotGoogleErrorAppClosed:) name:@"gotGoogleErrorAppClosed" object:nil];
obj_google = [[google alloc]init];
personName=[[GTLPlusPersonName alloc]init];
// google + code
signIn = [GPPSignIn sharedInstance];
signIn.shouldFetchGooglePlusUser = YES;
signIn.shouldFetchGoogleUserID = YES;
signIn.shouldFetchGoogleUserEmail = YES;
signIn.clientID = @"384945330563-pcls0t8c28s1jf7qiod9555sg7edfqhj.apps.googleusercontent.com";
signIn.scopes = @[ kGTLAuthScopePlusLogin ];
signIn.delegate = obj_google;
[signIn authenticate];
return obj_google;
}
这是我的退出功能
-(void)signOut
{
[signIn disconnect];
[signIn signOut];
}
答案 0 :(得分:1)
您可以使用GPPSignIn对象的signOut方法注销您的用户,例如:
- (void)signOut {
[[GPPSignIn sharedInstance] signOut];
}
此后撤销令牌并断开应用程序。
有关详细信息,请访问: - https://developers.google.com/+/mobile/ios/sign-in#sign_out_the_user