【问题标题】:Google Plus API Authorization: request_visible_actionsGoogle Plus API 授权:request_visible_actions
【发布时间】:2013-08-18 20:23:42
【问题描述】:

我正在使用 GTL framework 将 Google Plus 集成到我的可可应用程序中。

当我尝试插入一个新时刻时,它失败并出现错误 401(未经授权)。在this 帖子中,TO 通过在将用户重定向到授权页面时包含request_visible_actions 参数解决了这个问题。但是怎么做呢?

我有一个 GTMOAuth2WindowController 的实例,它会自动创建 URL。那么如何添加request_visible_actions 参数呢?如果不可能,如何创建整个 URL?

【问题讨论】:

标签: objective-c api oauth-2.0 google-plus google-oauth


【解决方案1】:

我解决了这个问题!我必须像这样创建GTMOAuth2WindowController

GTMOAuth2Authentication *auth = [GTMOAuth2SignIn standardGoogleAuthenticationForScope:kGTLAuthScopePlusLogin clientID:kClientID clientSecret:kClientSecret];
NSString *authURLString = [[[GTMOAuth2SignIn googleAuthorizationURL] absoluteString] stringByAppendingString:@"?request_visible_actions=http://schemas.google.com/AddActivity"];

NSBundle *frameworkBundle = [NSBundle bundleForClass:[GTMOAuth2WindowController class]];
GTMOAuth2WindowController *windowController = [GTMOAuth2WindowController controllerWithAuthentication:auth
                                                                                                       authorizationURL:[NSURL URLWithString:authURLString]
                                                                                                          keychainItemName:nil
                                                                                                           resourceBundle:frameworkBundle];

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-12-26
  • 1970-01-01
相关资源
最近更新 更多