在我的应用程序中,用户可以选择使用 google + 登录到应用程序?这里登录页面仅显示一次,当用户从下一次点击 google Plus 按钮时第一次点击 google plus 按钮时,它直接导航到权限页面而不是登录页面
我的代码是
/////////////登录代码
GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.delegate = self;
signIn.shouldFetchGooglePlusUser = YES;
signIn.shouldFetchGoogleUserEmail = YES; // Uncomment to get the user's email
signIn.shouldFetchGoogleUserID= YES;
signIn.clientID = kClientId;
signIn.scopes = [NSArray arrayWithObjects:
kGTLAuthScopePlusLogin, // defined in GTLPlusConstants.h
nil];
signIn.actions = [NSArray arrayWithObjects:@"http://schemas.google.com/ListenActivity",nil];
[signIn authenticate];
//////////////////////注销代码
- (void)Logout:(id)sender {
[[GPPSignIn sharedInstance] signOut];
[self performSelector:@selector(disconnect) withObject:nil afterDelay:1.0f];
}
- (void)disconnect {
[[GPPSignIn sharedInstance] disconnect];
}