Google API plus iOS API for share preloading data is out of date, which is an alternative

I need to share text, url and image in google plus from iOS app. The Google plus sign is outdated, and only general sharing with text + url is available, which is similar to the iOS G + resource. But I want to share image, url, etc. With my iOS app. Is there any other way to share information with text on Google plus now.

+4
source share
1 answer

The Google link supports two url parameters: urlfor the destination URL and hlfor the language code.

- (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 browser
     [[UIApplication sharedApplication] openURL:url];
    }
}
0
source

Source: https://habr.com/ru/post/1621931/


All Articles