5

このリンクを使用して Google+ で共有できると聞きました https://plus.google.com/share?url=YOUR_URL_HERE

「共有/投稿」にテキストを追加するにはどうすればよいですか? (Twitter のように、'prefilled text' パラメータを設定できます) URL パラメータは何ですか? 誰か助けてくれませんか?

4

2 に答える 2

6

アプリを Google+ と緊密に統合したい場合は、https ://developers.google.com/+/mobile/ios/ で概説されている SDK を使用することをお勧めします。

共有について: https://developers.google.com/+/mobile/ios/#share_on_google

共有オブジェクトを作成します。

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

Google+ URL ハンドラ:

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

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

  // ...
}
于 2012-10-04T13:27:14.150 に答える
1

私は少し調査を行い、これを思いつきました:

とはいえ、共有ページを管理していれば、+1-share-thingy のコンテンツに影響を与えることができるはずです。そうでない場合、これを行う方法はまだないようです。

また、この質問は、2012年2月26日にVitali Ponomarによって尋ねられたこの質問とほぼ正確に重複しているようです

于 2012-10-04T10:40:50.320 に答える