iOS Google+ SignIn finishedWithAuth从未在application:openURL:sourceApplication:annotation:应用程序委托方法之后触发。这是可行的,但现在没有。

响应为:

url:com.**************:/oauth2callback?state=19139956&code=4/<some token string>&authuser=0&num_sessions=1&prompt=consent&session_state=9efdca9285835ed58ace73b284e4f7521076fc97..4291*


signIn实例是一个类成员,所以我不知道finishedWithAuth触发会发生什么。

谢谢!

最佳答案

  -(void)googlePluseLogin
{
    GPPSignIn *signIn  = [GPPSignIn sharedInstance];
    signIn.delegate = self;
    signIn.shouldFetchGooglePlusUser = YES;
    signIn.shouldFetchGoogleUserEmail = YES;
    signIn.clientID = kClientID;
    signIn.scopes = @[@"profile"];
    if (![signIn trySilentAuthentication])
        [signIn authenticate];
}

-(void)finishedWithAuth:(GTMOAuth2Authentication *)auth error:(NSError *)error
{
    NSLog(@"%@",auth);

    if (error)
    {

    }
    else
    {
    }

}

关于ios - 在应用程序openURL委托(delegate)后未调用iOS Google+登录InfinishWithWithAuth,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25238221/

10-12 13:00