G + sdk给出登录错误? [英] G+ sdk giving login error?

查看:283
本文介绍了G + sdk给出登录错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已实施 Google Plus Api 并按原样登录在网站上给出。但是当我点击允许访问时登录后会出现问题,如下所示:

I have implemented Google Plus Api and login as it is given in the site. But it is giving problem after login when I click on allow Access as shown below:

出现以下消息:

我的代码如下,请告诉我还剩下什么:

My Code is as follows,pls tell me If anything left:

    - (void)viewDidLoad
{
 self.signInButton.delegate = self;
 self.signInButton.clientID = kClientId;
 self.signInButton.scope = [NSArray arrayWithObjects:
                            @"https://www.googleapis.com/auth/plus.me",
                            nil];

 SLNetworkAppDelegate *appDelegate = (SLNetworkAppDelegate*)
 [[UIApplication sharedApplication] delegate];
 appDelegate.signInButton = self.signInButton;

 share =[[GPPShare alloc] initWithClientID:kClientId];
 share.delegate = self; // optional
 appDelegate.share=share;

    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (IBAction) didTapShare: (id)sender {
 [[[[share shareDialog]
    setURLToShare:[NSURL URLWithString:@"https://developers.google.com/+/mobile/ios/getting-started"]]
   setPrefillText:@"testing share via google plus"] open];

 // Or, without a URL or prefill text:
 [[share shareDialog] open];
}


In App delegate file:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
 if ([signInButton handleURL:url
           sourceApplication:sourceApplication
                  annotation:annotation]) {
  return YES;
 }
 if ([self.share handleURL:url
         sourceApplication:sourceApplication
                annotation:annotation]) {
  return YES;
 }
 return NO;
}


推荐答案

你必须分配重定向uri在您的项目中使用您的捆绑ID,因此在成功验证后,如果您正确处理您的URL,您的应用程序将从safari启动:

You have to assign redirect uri in your project with your bundle ID like this so after successful authentication your application will be launched from safari if your handle your url properly:

将捆绑包ID作为标识符和URLSchemes ...

Place bundle Id as identifier and URLSchemes...

这篇关于G + sdk给出登录错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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