应用程序openURL委托后未调用iOS Google+登录InfinishWithWithAuth [英] iOS Google+ SignIn finishedWithAuth not called after application openURL delegate

查看:105
本文介绍了应用程序openURL委托后未调用iOS Google+登录InfinishWithWithAuth的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

iOS Google+ SignIn finishedWithAuth never triggered after the application:openURL:sourceApplication:annotation: app delegate method. This was working, but now it does not.

响应为:

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

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

The signIn instance is a class member, so I don't know what happens for the finishedWithAuth triggering.

谢谢!

推荐答案

  -(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
    {
    }

}

这篇关于应用程序openURL委托后未调用iOS Google+登录InfinishWithWithAuth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆