IPhone App - Google Plus Share with Prefill Text

I heard that we can use this link to post on Google+ https://plus.google.com/share?url=YOUR_URL_HERE

How to add text to "share / post"? (for example, on Twitter, I can set the parameter "pre-filled text"). What is the URL parameter for it? Can anyone help?

+5
source share
2 answers

If you want to integrate your application tightly into Google+, I would recommend using their SDK described here: https://developers.google.com/+/mobile/ios/

Bit for sharing: https://developers.google.com/+/mobile/ios/#share_on_google

Create your shared object:

GooglePlusShare *share =
    [[[GooglePlusShare alloc] initWithClientID:clientID] autorelease];
share.delegate = self; // optional
appDelegate.share = share; //optional

IBAction:

- (IBAction) didTapShare: (id)sender {
  // Add code here to retrieve the value of "share"
  // This could be self.share if this is a property of your ViewController
  // or ((MyAppDelegate *)[[UIApplication sharedApplication] delegate]).share

  [[[[share shareDialog]
      setURLToShare:[NSURL URLWithString:@"URL_TO_SHARE"]]
          setPrefillText:@"YOUR TEXT HERE"] open];

  // Or, without a URL or prefill text:
  [[share shareDialog] open];
}

URL- Google+:

- (BOOL)application: (UIApplication *)application
              openURL: (NSURL *)url
    sourceApplication: (NSString *)sourceApplication
           annotation: (id)annotation {
  // ...

  if ([self.share handleURL:url
          sourceApplication:sourceApplication
                 annotation:annotation]) {
    return YES;
  }

  // ...
}
+6

:

, + 1-share-thingy , . , .

: 2012-02-26

+1

All Articles