我已经实现了Google Plus Api并按照网站中给出的方式登录。但是当我点击允许访问时,登录后出现问题,如下所示:
出现以下消息:
我的代码如下,如果还有什么,请告诉我:
- (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;
}