2016-01-29 75 views
0

Google plus SDK已集成到我的一個應用中,用於共享應用內容。在iOS應用中使用Google+ SDK

對於此用戶必須登錄到應用程序的Google plus帳戶,然後使用此共享功能。

但是,在Google開發人員網站中,Google Plus登錄已被棄用,我們需要實施Google登錄,而不是Google Plus登錄。

我沒有使用Google Plus只是爲了登錄功能。

那麼,我現在該做什麼?

回答

0

如果你在分享只是興趣,你也許應該using the SFSafariViewController to present the share dialog box in a webview

- (void)showGooglePlusShare:(NSURL*)shareURL { 

    // 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]; 
    } 
} 
相關問題