简体   繁体   中英

Open Facebook app from other app

Is there a way to open the Facebook app from my own application?

For example, I'm using the Facebook-api to post something on the logged in users wall. When I get a call back that the post was successfully added I would like to open the Facebook app (if application is installed on the device) on the users wall to show them their post is there.

Answers for iPhone or Android or both would be much appreciated.

For the iphone, you can launch the Facebook app if installed by using a url starting with fb://

More information can be found here: http://iphonedevtools.com/?p=302 also here: http://wiki.akosma.com/IPhone_URL_Schemes#Facebook

Stolen from the above site:

  • fb://profile – Open Facebook app to the user's profile
  • fb://friends – Open Facebook app to the friends list
  • fb://notifications – Open Facebook app to the notifications list (NOTE: there appears to be a bug with this URL. The Notifications page opens. However, it's not possible to navigate to anywhere else in the Facebook app)
  • fb://feed – Open Facebook app to the News Feed
  • fb://events – Open Facebook app to the Events page
  • fb://requests – Open Facebook app to the Requests list
  • fb://notes - Open Facebook app to the Notes page
  • fb://albums – Open Facebook app to Photo Albums list

To Launch:

NSURL *theURL = [NSURL URLWithString:@"fb://<insert function here>"];
[[UIApplication sharedApplication] openURL:theURL];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM