Ios 验证允许访问后google API重定向url失败

Ios 验证允许访问后google API重定向url失败,ios,google-api,Ios,Google Api,大家好,这是我第一次发问,可能会犯一些错误。 所以我想创建一个iOS应用程序,它可以让用户管理youtube内容,这意味着如果用户需要,我需要使用oAuth2.0Google API进行身份验证 我使用的oAuth2的第三方代码是OAuth2Client。几天后 几个小时后,我就可以进入谷歌的认证页面了。但在单击“允许访问”或“拒绝”后,页面仍停留在那里。我只是想知道它是否应该是那样的,或者我的代码有什么问题 这是我的oAuth2代码 + (void)initialize; { [[NXOAut

大家好,这是我第一次发问,可能会犯一些错误。 所以我想创建一个iOS应用程序,它可以让用户管理youtube内容,这意味着如果用户需要,我需要使用oAuth2.0Google API进行身份验证

我使用的oAuth2的第三方代码是OAuth2Client。几天后 几个小时后,我就可以进入谷歌的认证页面了。但在单击“允许访问”或“拒绝”后,页面仍停留在那里。我只是想知道它是否应该是那样的,或者我的代码有什么问题

这是我的oAuth2代码

+ (void)initialize;
{
[[NXOAuth2AccountStore sharedStore]  setClientID:@"243181519584.apps.googleusercontent.com"
                                         secret:@"9b_K3C-kYp791Syga5K47cFS"
                                          scope:[NSSet setWithObject:@""]
                               authorizationURL:[NSURL URLWithString:@""]
                                       tokenURL:[NSURL URLWithString:@""]
                                    redirectURL:[NSURL URLWithString:@""]
                                 forAccountType:@"NBAvideo"];

}


//send request for logging in
[[NXOAuth2AccountStore sharedStore] requestAccessToAccountWithType:@"NBAvideo"];


//add observer
[[NSNotificationCenter defaultCenter] addObserverForName:
 NXOAuth2AccountStoreAccountsDidChangeNotification     object:[NXOAuth2AccountStore sharedStore]
                                                   queue:nil
                                              usingBlock:^(NSNotification *aNotification){
                                                  NSLog(@"Success!");
                                                  }];

[[NSNotificationCenter defaultCenter] addObserverForName:NXOAuth2AccountStoreDidFailToRequestAccessNotification
                                                  object:[NXOAuth2AccountStore sharedStore]
                                                   queue:nil
                                              usingBlock:^(NSNotification *aNotification){
                                                  NSError *error = [aNotification.userInfo objectForKey:NXOAuth2AccountStoreErrorKey];
                                                  NSLog(@"Failure !");
                                              }];
单击“允许访问”或“拒绝”后,页面url就是我的重定向url+代码 =………,我想知道我怎么能做到这一点,因为当我将observer添加到通知中心时,我的应用程序服务器没有听到任何声音。当我注册产品时,谷歌api中心给了我重定向url,我在代码中使用了“localhost”,只是想知道这是否正确。任何人都可以帮助我,我整天都在寻找解决方案

谢谢大家!