认证完成后不会调用finishedWithAuth方法

Utt*_*dam 0 authentication ios google-plus

我正在为iOS登录Google+登录.

我正在调用身份验证方法

  [signIn authenticate];
Run Code Online (Sandbox Code Playgroud)

我没有使用signin对接.

在这种情况下,验证后不会调用以下方法

- (void)finishedWithAuth: (GTMOAuth2Authentication *)auth
                   error: (NSError *) error
Run Code Online (Sandbox Code Playgroud)

请告诉我有没有办法处理回调?

Vai*_*ran 10

你一步一步Google+ Sign-In for iOS说了什么?如果是,那么你必须错过关键的一步.

第5步

在你的AppDelegate.m文件中

#import <GooglePlus/GooglePlus.h>
Run Code Online (Sandbox Code Playgroud)

第6步

GPPURLHandler从app delegate的URL处理程序中调用URL处理程序.此处理程序将正确处理应用程序在身份验证过程结束时收到的URL.

- (BOOL)application: (UIApplication *)application openURL: (NSURL *)url sourceApplication: (NSString *)sourceApplication annotation: (id)annotation
{
    return [GPPURLHandler handleURL:url sourceApplication:sourceApplication annotation:annotation];
}
Run Code Online (Sandbox Code Playgroud)

当您的应用程序在Google+ OAuth之后返回时,系统会调用此方法,并立即调用此方法

- (void)finishedWithAuth: (GTMOAuth2Authentication *)auth error: (NSError *) error
Run Code Online (Sandbox Code Playgroud)

你的方法 viewController

现在就试试.