Reputation: 492
I've just started using the facebook-ios-SDK. I'm trying to run the sample app to get a feel for how the framework works. I have never used the FB Graph API before, or indeed used FB connect. When the APP runs I can tap the Login button, and Safari launches to authorise the FB app with my account. Once I have authorised it I think the page tries to redirect and switch back to the sample app but fails, with safari showing "Cannot Open Page".
Where am I going wrong?
Upvotes: 2
Views: 1342
Reputation: 1396
You probably need to setup an authorization callback. This is from SDK's readme file:
Bind your application to a URL scheme corresponding to your Facebook application ID. The URL scheme you must bind to is of the format "fb[appId]://", where [appId] is your Facebook application ID. Without this, your application won't be able to handle authorization callbacks. Modify your application's .plist file as follows:
- Under the root key ("Information Property List") add a new row and name the key "URL types".
- Under the "URL types" key that you just added, you should see a key named "Item 0". If not, add a new row with key "Item 0".
- Under the "Item 0" key, add a new row and name the key "URL Schemes".
- Under the "URL Schemes" key that you just added, you should see a key named "Item 0". If not, add a new row with key "Item 0".
- Set the value of "Item 0" to "fb[appId]" where [appId] is your Facebook application ID. Make sure there are no spaces anywhere in this value. For example, if your application's id is 1234, the value should be "fb1234".
Upvotes: 5