[英]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.