how to post URL with Image on facebook by ShareKit

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];
}
link | improve this question

 
feedback

2 Answers

up vote 1 down vote accepted

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.

link | improve this answer
 
feedback

Maybe what you want is a url item, with an image attached to it. If so, you can do this :

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

I've implemented this with the latest sharekit, it works for me.

link | improve this answer
 
This doesn't appear to work, but this solution does: stackoverflow.com/questions/7122414/… –  cannyboy  Aug 31 at 15:25
feedback
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值