2

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?

2
3

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

2
  • @kopischke good point, I didn't even notice that! I wonder why did they left this old UI in the application? btw, recently it turned out that this does not work with Facebook's iPad app. – szajmon Oct 17 '11 at 12:35
  • Confirmed, this is not currently working on iPads, but work fine on iPhones, etc. Can't ensure that the facebook app is installed...etc. – ort11 Feb 21 '12 at 18:59
2

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];
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.