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

Far*_*eid 5 objective-c ios google-plus google-signin

由于Google+ iOS SDK使用移动版Safari对用户进行身份验证,我的某个应用程序被拒绝了.我已浏览网页,我一直在关注此链接中的解决方案,以启动我的应用并运行Google+.我最近看到了Google登录iOS的公告,它解决了使用SDK提供的webview在应用内进行身份验证的问题.

这就是出现问题的地方,我希望用户能够在Google+上分享,但我无法在Google登录SDK中看到要分享的选项,而最新的Google+ SDK仍在使用移动版Safari进行身份验证.我现在有两个问题:

  1. 我可以同时使用两个SDK来验证和共享和使用authCode吗?
  2. 我是否遗漏了这两个SDK中的内容以进行登录或共享?Google+是否可以选择在应用内进行身份验证,还是Google登录有助于在Google+上进行分享?

iOS*_*ser 0

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];
Run Code Online (Sandbox Code Playgroud)