Share content to Facebook from iOS 5 app
Asked Answered
H

3

8

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!!

Hypoacidity answered 10/3, 2012 at 19:49 Comment(2)
If you only want to integrate Facebook in your application and no other sharing services are needed, you might want to simply have a look on Facebooks own API. It's quite straightforward. developers.facebook.com/docs/mobile/ios/buildIceskate
Now in my app you can share with mail and twitter and I would like to share on Facebook too. But i don't want to integrate Facebook at all, ONLY sharing.Hypoacidity
K
11

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];
Kania answered 10/3, 2012 at 21:16 Comment(4)
But how can I ONLY share a app's string and photo. I need something simpler.Hypoacidity
You mean your app's name? If so, that'll automatically show at the bottom of the post. For posting a photo, check out this question: #4260073Kania
I +1 this answer. When you only want to integrate a few services, SharingKit is rarely what you are looking for. Also, Facebook has a great SDK supported by good tutorials to get you going.Iceskate
will you answer this question?Bathsheeb
S
4

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/

Sternforemost answered 1/8, 2012 at 0:3 Comment(0)
S
3

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.

Stigmatism answered 10/3, 2012 at 19:54 Comment(1)
What is the error? Have you looked at the bug reports on github for something similar? They are very active in squashing them.Stigmatism

© 2022 - 2024 — McMap. All rights reserved.