greenhorn
greenhorn

Reputation: 1107

Facebook publish_actions to timeline for iOS

After searching Facebook developer documentation / bugs, and questions on stackoverflow.com, it's not clear if Facebook now supports publish_actions to timeline via it's iOS SDK. There are some questions here on this site that relates to publish_actions permission on mobile, but they don't provide any solution.

  1. Has Facebook rolled out publish_actions for mobile for all third party apps or is it still restricted to devs?
  2. Does Facebook allows publishing actions to timeline via it's publish_actions permission via iOS SDK?
  3. Are there any examples, sample code, or tutorials that explain how to achieve it on iOS?

I'd appreciate any pointers.

Upvotes: 1

Views: 2607

Answers (3)

sathiamoorthy
sathiamoorthy

Reputation: 1496

No, publish_action will not support for posting in timeline. You should add a new tag like fb:explicitly_shared. Set this as BOOL value. If you set true, it will show in the user's timeline, else it will not.

Upvotes: 0

Endre Olah
Endre Olah

Reputation: 955

I cannot make this work. I have already got my action released by Facebook so sample had been sent from CURL, but from IOS I always get back domain error 1000.

Here is my code:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"http://itunes.apple.com/us/app/ginos-challenge/id509946175",@"og.url",
                               @"Played on Gino's challenge",@"og:title",
                               @"http://media.appspy.com/thumbs/images/icons/i509946175_jpg_180x180_q85.jpg",@"og:image",
                               @"This is my first post",@"og:description", 
                               @"1000", @"game_point",
                               nil];

// Publish.
// This is the most important method that you call. It does the actual job, the message posting.
[facebook requestWithGraphPath:@"me/[action domain]:[action name]" andParams:params andHttpMethod:@"POST" andDelegate:self];

Upvotes: 0

Simon Cross
Simon Cross

Reputation: 13345

Yes. Publishing actions works from within iOS just like it works on the Desktop Web, Mobile Web and from within Android.

The method of requesting the publish_actions permission is the same is uses to request any other permission.

The method of publishing actions is the same Graph API call as you make from any platform:

POST https://graph.facebook.com/me/APP_NAMESPACE:ACTION_NAME?OBJECT_NAME=OBJECT_URL&access_token=TOKEN

for example

POST https://graph.facebook.com/me/myapp:cook?recipe=http://exmaple.com/recipe&access_token=TOKEN

In Objective C you might have something like

AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[[delegate facebook] requestWithGraphPath:@"me/myapp:cook" andParams:@"http://exmaple.com/recipe" forKey:@"recipe"] andHttpMethod:@"POST" andDelegate:self];

Upvotes: 2

Related Questions