应用程序 openURL 委托(delegate)后未调用 iOS Google+ SignIn finishedWithAuth

标签 ios objective-c google-plus

iOS Google+ SignIn finishedWithAuth 从未在 application:openURL:sourceApplication:annotation: 应用委托(delegate)方法之后触发。这在起作用,但现在不起作用。

响应是:

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

}

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

相关文章:

ios - 无法使用类型为 '*' 的参数列表调用 '(NSURL, *: NSString?)'

iphone - 字典值检索

ios - 在图像选择器 iOS 中调整编辑矩形的大小

java - Google + Domains API Java 快速启动不起作用

ios - 键盘和文本字段一起动画进入 View

ios - 取消 tabbarcontroller 时弹出到 rootviewcontroller?

ios - Google+ iOS SDK 不响应委托(delegate)方法

ruby-on-rails-3.2 - Google plus 在流中插入事件

objective-c - 在 CALayer 上显示 NSImage

ios - 志愿者匹配 API Objective-C