簡體   English   中英

不推薦使用Google plus iOS API來預先填充共享中的數據,還有什么選擇

[英]Google plus iOS API to pre-fill data in share is deprecated, what is the alternative

我必須在iOS應用中分享Google Plus中的文字,網址和圖片。 Google plus登錄已棄用,只提供與text + url的基本共享 ,這與本機iOS G +共享相同。 但我想從我的iOS應用程序中分享圖片,網址等。 有沒有其他方法可以在Google plus中與文本共享媒體。

谷歌共享鏈接支持兩個網址PARAMATERS: url目標URL和hl的語言代碼。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM