facebook-ios-SDK问题 [英] facebook-ios-SDK question
问题描述
我在哪里出错?
你可能需要设置授权回调。
这是从SDK的自述文件:
将您的应用程序绑定到与您的
Facebook应用程序ID相对应的URL方案。您必须绑定的URL方案是
格式fb [appId]://,其中[appId]是您的Facebook应用程序
ID。没有这个,您的应用程序将无法处理
授权回调。修改您的应用程序的 .plist 文件为
如下:
- 根密钥(信息属性列表)添加一个新行,
命名关键字URL类型。
- 在刚刚添加的URL类型键下,应该会看到一个名为项目0。如果没有,请添加一个带有项目0的新行。
- 在项目0键下,添加一个新行并命名关键字URL方案。
- 在URL方案键下你刚刚添加,你应该看到一个名为项目0的键。如果没有,请添加一个带有项目0的新行。
- 将项目0的值设置为fb [appId],其中[appId]是您的Facebook应用程序ID。确保此值中的任何位置没有空格。例如,如果您的应用程序的ID为1234,则该值应为fb1234。
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?
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".
这篇关于facebook-ios-SDK问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!