gpt4 book ai didi

ios - G+ sdk 出现登录错误?

转载 作者:技术小花猫 更新时间:2023-10-29 10:40:58 26 4
gpt4 key购买 nike

我已经实现了 Google Plus Api并按网站中提供的方式登录。但是当我点击允许访问时登录后出现问题,如下所示:

enter image description here

出现以下消息:

enter image description here

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

    - (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;
}

最佳答案

您必须像这样使用您的包 ID 在您的项目中分配重定向 uri,以便在成功验证后,如果您正确处理您的 url,您的应用程序将从 safari 启动:

enter image description here

将 bundle Id 作为标识符和 URLSchemes...

关于ios - G+ sdk 出现登录错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14036837/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com