gpt4 book ai didi

ios - 使用适用于 iOS 的 Google 登录在 Google+ 上分享

转载 作者:可可西里 更新时间:2023-11-01 04:56:54 27 4
gpt4 key购买 nike

由于 Google+ iOS SDK 使用移动 safari 对用户进行身份验证,我的一个应用程序被拒绝了。我已经上网冲浪,并且一直在关注此 link 中的解决方案为 Google+ 启动并运行我的应用程序。我最近看到了 iOS 版 Google 登录的公告,它解决了使用 SDK 提供的 webview 在应用程序内进行身份验证的问题。

这就是问题所在,我希望用户能够在 Google+ 上分享,但我在 Google 登录 SDK 中看不到分享选项,最新的 Google+ SDK 仍在使用移动 safari 进行身份验证。我现在有两个问题:

  1. 我可以同时使用两个 SDK 进行身份验证并共享和使用 authCode 吗?
  2. 我是否在这两个 SDK 中缺少登录或共享的内容? Google+ 能否提供在应用内进行身份验证的选项或 Google 登录有助于在 Google+ 上分享内容?

最佳答案

NSURL *shareURL = [NSURL URLWithString:@"https://blog.xamarin.com/keep-users-engaged-with-ios-9s-sfsafariviewcontroller/"];
// Construct the Google+ share URL
NSURLComponents* urlComponents = [[NSURLComponents alloc]
initWithString:@"https://plus.google.com/share"];
urlComponents.queryItems = @[[[NSURLQueryItem alloc]
initWithName:@"url"
value:[shareURL absoluteString]]];
NSURL* url = [urlComponents URL];

if ([SFSafariViewController class]) {
// Open the URL in SFSafariViewController (iOS 9+)
SFSafariViewController* controller = [[SFSafariViewController alloc]
initWithURL:url];
controller.delegate = self;
[self presentViewController:controller animated:YES completion:nil];
} else {
// Open the URL in the device's browser
[[UIApplication sharedApplication] openURL:url];

关于ios - 使用适用于 iOS 的 Google 登录在 Google+ 上分享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30908942/

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