Take the 2-minute tour ×

I'm trying to implement the functionality of sharing stuff on Facebook in my iPhone app. After walking through https://developers.facebook.com/docs/mobile/ios/build/ It's giving me some trouble!

I use a singleton class to contain the Facebook object. When I click the button to share something, the browser opens and I can login to fb. After that I can press 'okay' and it should redirect me to the app again. Sadly, I get an error message from safari: 'Safari cannot open the page because the address is invalid'

Obviously it's my first time trying to implement fb in an iOS app....

Does anyone have an idea?

Thanks ;-)

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You need to register a URL Scheme for your application so it can be opened from browser/other applications (like Facebook's official one).

This is described in Step 3: Implementing Single Sign-On (SSO) part of the tutorial you refer to (especially "Modify the app property list file" section).

share|improve this answer
Thanks a lot, I used url identifier instead of url scheme.... –  Tommy Peters Apr 19 '12 at 23:28

Check the following in your implementation :

1.you need to add the following functions in your application delegate(the facebook object here is your instance value of FaceBook Class).

// Pre 4.2 support
   return [facebook handleOpenURL:url]; 

// For 4.2+ support
   return [facebook handleOpenURL:url]; 

2.In your info.plist add to URL types > URL Schemes > your Facebook app ID with fb prefix (finally your value will be like this for ex. fb313714***).

share|improve this answer

Your Answer


