2011-05-05 37 views
0

如何在Facebook上上傳圖片時在Facebook上發佈消息?在Facebook上發佈消息以及圖片

在我的項目中,我使用FBFeedPost在Facebook上上傳圖片,並且工作正常,但我必須隨圖像一起發佈消息。

+1

可能的重複:[1](HTTP (http://stackoverflow.com/questions/2437574/)[2](http://stackoverflow.com/questions/5881676/)[3](http://stackoverflow.com/questions/5391136/)[ 4](http://stackoverflow.com/questions/2498398/)[5](http://stackoverflow.com/questions/5637252/)[6](http://stackoverflow.com/questions/4351830/) [&c。](http://stackoverflow.com/search?q=message+facebook+%5Bobjc%5D) – 2011-05-05 19:46:23

回答

1

我推薦ShareKit,輕鬆設置並支持您所要求的臉書功能。

安裝的授權之後,以剛做:

SHKSharer *service = [[[SHKFacebook alloc] init] autorelease]; 
[service authorize]; 

之後,它的

SHKItem *item = [SHKItem image:myImage title:@"Look at me!"]; 
[SHKFacebook shareItem:item]; 

的圖像和文字:

SHKItem *item = [SHKItem text:text]; 
[SHKFacebook shareItem:item]; 
+0

如何添加圖片,網址和標題? SHKItem * item = [SHItem image:myImage url:url title:@「看看我!」];給出了太多的參數錯誤。謝謝 – hanumanDev 2011-05-15 23:56:57

+0

我也建議你給[BMSocialShare](http://github.com/blockhaus/BMSocialShare)一個嘗試,我寫的庫。如果您只想使用Facebook,Twitter和電子郵件,它比ShareKit簡單。 – vinzenzweber 2012-05-17 13:35:14