4
我必須在iOS應用的Google plus中共享文本,網址和圖片。 Google加入登錄已棄用,只有basic sharing帶有文本+網址,與原生iOS G +共享相同。但我想從我的iOS應用分享圖片,網址等。現在有沒有其他方式可以在Google plus中與文字分享媒體。谷歌加iOS API來預先填充共享數據已被棄用,替代方案是什麼
我必須在iOS應用的Google plus中共享文本,網址和圖片。 Google加入登錄已棄用,只有basic sharing帶有文本+網址,與原生iOS G +共享相同。但我想從我的iOS應用分享圖片,網址等。現在有沒有其他方式可以在Google plus中與文字分享媒體。谷歌加iOS API來預先填充共享數據已被棄用,替代方案是什麼
Google share link支持兩個url參數: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];
}
}
@Kurt Van den Branden你好我已經嘗試了上面的代碼,但它直接將我重定向到谷歌加個人資料頁面,我嘗試在桌面瀏覽器中粘貼相同的URL,它顯示我的帖子窗口。你能幫我解決問題嗎? –