Facebook URL scheme to post a new message from iPhone
I am developing an iPhone application, and wan开发者_C百科t it to be able to post a message to Facebook, by using the Facebook app.
Is there a custom URL to do this?
I've found this page that has a list of Facebook commands, but it doesn't say how to post a new message...
The URL to post a new message to the wall is
fb://publish/?text=some text to post
This works with Facebook app 4.1... I don't know if it works with older versions.
This answer might help you... Especially this : fb://messaging/compose
If you are talking about using a feed post then you have to do this:
[facebook dialog:@"feed" andDelegate:self];
See here for more info
Also if your making this a mobile web app then you could try this:
http://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&display=touch
More info on web app
You could also just use Sharekit, that gives your users the option what to share. Otherwise, you'll have to use the FBDialog from the facebook-ios-sdk or a matching webview using the URL given by the other posters
The method you mention, directly calling the facebook app, a) requires the app to be installed (usually not the case on iPads, for example) and b) is not officially supported by facebook - the two other ways are.
精彩评论