I’ve got some code that does a bunch of set-up, then posts to Facebook using FB-connect. At one point, I have something like this:
NSString *description =
@"Wow, what a great app! "
@"Download it free: "
@"<a href=\"http://itunes.apple.com/us/app/myApp/id12345?mt=8\">"
@"On iTunes AppStore."
@"</a>"
;
// post FB dialog
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
// @"This is what I say about myApp:", @"message", // user msg
@"MyApp!", @"name", // Bold/blue name
@"MyApp is cool!", @"caption", // 1st line
description, @"description", // 2nd line
@"http://itunes.apple.com/us/app/myApp/id12345?mt=8", @"link",
@"http://farm6.static.flickr.com/5230/5576336654_075c2abcf9_s.jpg", @"picture",
nil];
[facebook dialog: @"feed"
andParams: params
andDelegate: self];
And it ALMOST works! The only problem is: in my description string, everything between “<a href...” and “</a>” doesn’t display on my facebook wall.
So the question is: how do I add a link (anchor-tag style) as part of my post?
It is not possible to add links in the description, however you can achieve the same result using the “properties” and “actions” keys, as documented here:
Facebook API Feed Dialog Documentation
The code would be as follows:
The properties will appear in the stream attachment beneath the description, with each property on its own line.
The actions will appear next to the “Comment” and “Like” link under posts.
In the attached screenshots you will see how both properties and actions look like.
The first screenshot shows how it looks when the dialog pops up on the iPhone.
The second screenshot shows the Facebook post with the properties object.
The third screenshot shows the Facebook post with both the properties and actions objects.
Hope this helps.