我听说我们可以使用此链接在Google+上分享 https://plus.google.com/share?url=YOUR_URL_HERE
我们如何在'分享/发布'中添加文字?(比如在Twitter中,我可以设置'预填充文本'参数)它的URL参数是什么?有人可以帮忙吗?
如果您想将自己的应用与Google+紧密集成,我建议您使用此处列出的SDK:https://developers.google.com/+/mobile/ios/
关于共享的内容:https://developers.google.com/+/mobile/ios/#share_on_google
创建共享对象:
GooglePlusShare *share =
[[[GooglePlusShare alloc] initWithClientID:clientID] autorelease];
share.delegate = self; // optional
appDelegate.share = share; //optional
Run Code Online (Sandbox Code Playgroud)
在按钮的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];
}
Run Code Online (Sandbox Code Playgroud)
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;
}
// ...
}
Run Code Online (Sandbox Code Playgroud)
我做了一些研究并提出了这个:
也就是说,如果您控制共享页面,您应该能够影响 +1-share-thingy 的内容。如果没有的话,似乎仍然没有办法做到这一点。
另外:这个问题似乎与 Vitali Ponomar 于 2012 年 2 月 26 日提出的问题几乎完全相同