简体   繁体   中英

Share content to Facebook from iOS 5 app

I'm developing a iOs 5 app and I would like that the user could share on Facebook some content from de app like text or images. I've tried to implement Sharekit (native fork and 2.0 modified fork) and Addthis but no one has worked. How can I do it? I was very close when I implement Sharekit 2.0 (modified fork) but it made some issues related to armv7. Is there some way for fixing them? Thanks for all!!

I highly recommend using Facebook's SDK. There's a very thorough tutuorial here: Facebook iOS SDK . Once you've followed the instructions there and have Facebook authorizing your users account, you can use calls to the Graph API to post a variety of things (example of posting a link with the Graph API):

NSMutableDictionary *params = [NSMutableDictionary dictionary];

[params setObject:@"Test post" forKey:@"message"];
[params setObject:@"link" forKey:@"type"];
[params setObject:@"http://yoursite.com" forKey:@"link"];
[params setObject:@"Link description" forKey:@"description"];

NSString *graphPath = @"me/feed";

[facebook requestWithGraphPath:graphPath andParams:params andHttpMethod:@"POST" andDelegate:self];

If you don't want to ask for additional permissions, you can use the Feed Dialog for iOS:

https://developers.facebook.com/docs/howtos/feed-dialog-using-ios-sdk/

If you are using IdeaShower's version of sharekit, it's no longer maintained. Try this one:

https://github.com/ShareKit/ShareKit

It's current and a lot of people keep it up to date.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM