1

私のアプリには、ユーザーがGoogle +を使用してアプリにログインするオプションがありますか?ここでは、ユーザーがGoogle Plusボタンをタップしたときに初めてログインページが1回だけ表示されます。次にGoogle Plusボタンをクリックすると、権限への直接ナビゲーションが表示されますloginPage に移動する代わりにページ

私のコードは

//////////////ログインコード

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];
  }
4

1 に答える 1