real propecia

Facebook Custom URL Scheme


Wouldn’t it be great if you could open the Facebook iPhone app from your app or webpage?  Turns out you can.  I did a little hacking and discovered a portion of the Facebook custom URL scheme.  iPhone developers can open different parts of the Facebook iPhone app by via the following code:

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

[[UIApplication sharedApplication] openURL:theURL];

Web developers can send iPhone users to the Facebook app as well with the URLs.  As far as I know this hasn’t been documented anywhere.  Here’s what I’ve found:

  • 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

As you can see there is a least one bug.  Perhaps Joe Hewitt hasn’t released information on the URL scheme because it’s not ready yet, so use at your own risk.  For now, the above functions work and that’s probably just scratching the surface.  There’s loads of potential for more functionality.  I would love a custom URL scheme that would allow the user to become a fan of my app on Facebook by opening the Facebook app with one click rather than asking them to login via Facebook Connect.  We’ll see what the future holds.  Want to see a Facebook app URL action?  If you’re browsing on your iPhone OS device, click here.

  1. #1 by Adrian on September 13th, 2009

    Hi there,
    I’ve added this information to my repository of iPhone URL Schemes:
    http://wiki.akosma.com/IPhone_URL_Schemes
    with a link to this page.
    Great website! Thanks for all the information. Keep it up!

  2. #2 by admin on September 13th, 2009

    Adrian,
    Thanks. Great resource. I just updated your wiki with the custom URL info for my app, Duo, which allows developers to send Tweets/Facebook updates via Duo and then return back to their app.

  3. #3 by Maarten on September 13th, 2009

    Hi Robert,

    Great find! I’ve copied this info as well, and added your Duo URL scheme while at it, to http://handleopenurl.com

    Thanks!

  4. #4 by admin on September 13th, 2009

    Maarten,
    Great site! I will add it to the iPhone Dev Tools directory.

  5. #5 by mare on September 14th, 2009

    If Joe Hewitt hasn’t published his URL scheme, maybe it’s because it’s not ready yet, or not for public consumption. If you, as a developer, use these URLs to open the FaceBook app, be prepared that that functionality can break at every update of the FaceBook app. And with the current review times at Apple it can take a long time to get a bug fix into the appStore.

    On another note I think developers should use the full app name for their URL scheme, not just an abbreviation. Claiming ‘fb’ means that an imaginary application that is actually named fb and has a custom URL scheme will clash with that of the FaceBook app.

    I also have a custom URL scheme in one of my apps, but it is only for inter-app communication and is not a public API. If one uses it without the proper parameters the app will open, but won’t do anything useful.

  6. #6 by Dennis on October 2nd, 2009

    Is there a way to direct link a button to the Become a Fan function?

  7. #7 by admin on October 3rd, 2009

    The functionality may be there, but as of now, I don’t know of a way. I do expect to see this in the future as this would be a very useful feature . If you wanted to experiment, you could try something like fb:// or fb://profile?id=XXXXXXXX and see if either of those work. If I find out anything I will post it here.

  8. #8 by Ted on May 4th, 2010

    True coolness. Thanks so much for discovering this. I successfully opened another user’s profile in the Facebook app launched from my app using fb://profile/. Cheers…

Comments are closed.