Sharekit - 发送 url 链接到 Facebook
下面是我使用 Sharekit 将图像和标题发送到 Facebook 的方法。我还想随 Facebook 帖子一起发送 URL。如果我尝试,
SHKItem *item = [SHKItem image:image url:url title:titleString];
我会收到太多参数错误消息。有谁对如何做到这一点有任何想法?感谢您的帮助。
- (IBAction)myButtonHandlerAction
{
NSURL *url = [NSURL URLWithString:@"http://example.com/"];
NSString *titleString = [[NSString alloc] initWithFormat:@"*** %@ * \n\nGet the ***** App - It's Free!", entity.name];
UIImage *image = [[[UIImage alloc] initWithData:entity.image] autorelease];
SHKItem *item = [SHKItem image:image title:titleString];
// Get the ShareKit action sheet
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
// Display the action sheet
[actionSheet showFromBarButtonItem:barbtn animated:YES];
}
Below is the method I'm using with Sharekit to send an image and a title to facebook. I also want to send a URL along with the facebook post. If I try
SHKItem *item = [SHKItem image:image url:url title:titleString];
I get a too many arguments error message. Does anyone have any ideas on how this should be done? thanks for any help.
- (IBAction)myButtonHandlerAction
{
NSURL *url = [NSURL URLWithString:@"http://example.com/"];
NSString *titleString = [[NSString alloc] initWithFormat:@"*** %@ * \n\nGet the ***** App - It's Free!", entity.name];
UIImage *image = [[[UIImage alloc] initWithData:entity.image] autorelease];
SHKItem *item = [SHKItem image:image title:titleString];
// Get the ShareKit action sheet
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
// Display the action sheet
[actionSheet showFromBarButtonItem:barbtn animated:YES];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有方法
-[SHKItem image:url:title:]
。因此会引发错误。目前,没有任何机制可以使用 ShareKit 执行您需要的操作,因此您必须根据您的需求自定义 ShareKit。您还应该查看Graph API。There is no method
-[SHKItem image:url:title:]
. So an error is being raised. Currently there is no mechanism to do what you require using ShareKit so you will have to customize ShareKit for your needs. You should also look at the Graph API.也许您想要的是一个 url 项目,并附加一个图像。如果是这样,你可以这样做:
我已经用最新的共享包实现了这个,它对我有用。
Maybe what you want is a url item, with an image attached to it. If so, you can do this :
I've implemented this with the latest sharekit, it works for me.