ValentiGoClimb
ValentiGoClimb

Reputation: 750

How to pass parameters to Facebook, fb://publish/?

From my iOS app, I want to open the Facebook application to make a post in the user wall. I want to give a predefined text to make the post, and I don't know how to add the text to the call.

 NSString *post = [NSString stringWithFormat:@"fb://publish"];
 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:post]];

How could I pass the text parameters with the "fb://publish/" option?

Upvotes: 2

Views: 4618

Answers (3)

szajmon
szajmon

Reputation: 1665

From Safari, some HTML like this seems to be working:

<a href="fb://publish/?text=#text#">...</a>

It opens up the Facebook application's share dialog with the text predefined, which you have to edit before you can actually share it. You can also include URLs into the text; Facebook converts that to a simple link once posted, but it does not add the image or any other meta details defined on that URL, as usual.

Note this redirects to the old style publish screen,

enter image description here

not the one the Facebook application has been using since version 3.4.

enter image description here

Upvotes: 3

Muhammad Towfique Imam
Muhammad Towfique Imam

Reputation: 1343

For posting status to facebook use this URL:fb://publish/profile/me?text=foo

Upvotes: 0

Govind
Govind

Reputation: 2348

First install the Facebook API and try this code...

 NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               FBAppID, @"130506840369385",
                               @"http://developers.facebook.com/docs/reference/dialogs/", @"link",
                               @"http://fbrell.com/f8.jpg", @"picture",
                               @"Facebook Dialogs", @"name",
                               @"sdsdds", @"caption",
                                @"asdasdasd", @"description",
                               @"hi goolwihdfkasnv",  @"message",
                               nil];

[facebook dialog:@"feed" andParams:params andDelegate:self];

Upvotes: 2

Related Questions