【问题标题】:Sharekit - sending a url link to facebookSharekit - 将 url 链接发送到 facebook
【发布时间】:2011-05-16 22:54:26
【问题描述】:

以下是我使用 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];
}

【问题讨论】:

    标签: iphone objective-c ios facebook sharekit


    【解决方案1】:

    没有方法-[SHKItem image:url:title:]。所以引发了一个错误。目前没有机制可以使用 ShareKit 完成您需要的操作,因此您必须根据需要自定义 ShareKit。您还应该查看Graph API

    【讨论】:

      【解决方案2】:

      也许您想要的是一个 url 项目,并附有图像。如果是这样,您可以这样做:

      SHKItem *item = [SHKItem URL:[NSURL URLWithString:@"http://example.com/"] title:@"Check this link"];
      [item setCustomValue:@"http://example.com/someimage.jpg" forKey:@"picture"];
      [SHKFacebook shareItem:item];
      

      我已经用最新的共享工具包实现了这个,它对我有用。

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-24
      • 1970-01-01
      • 1970-01-01
      • 2012-03-14
      • 2012-11-06
      • 2011-12-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多