不能执行授权给Facebook与iOS SDK和原生的Facebook应用程序 [英] Can't auth to Facebook with iOS SDK and native Facebook application
问题描述
我有什么和发生的问题干嘛:
What I have and what're problems occurred:
- 我已经与游戏应用程序(每天都有人的上场) 一个Facebook帐户
- 我已经多了一个Facebook帐户与测试应用程序,即使用默认设置最近创建的。
- 我在我的iPod已经原生的Facebook应用程序
- 我正在开发,它使用的Facebook的iOS SDK的iOS应用程序。
- I've one Facebook account with game application (every day people's playing)
- I've one more Facebook account with test application, that created recently with default settings.
- I've native Facebook application on my iPod
- I'm developing iOS application which uses Facebook iOS SDK.
无效流量:
如果我用从第一个应用程序的应用程序ID / API密钥,我打开我的应用程序,并试图登录。 Facebook的SDK打开本地FB应用程序,并告诉我,屏幕
If I use App ID/API Key from first application, I open my application and trying to login. Facebook SDK opens native FB application and show me that screen
我preSS确定,回到我的iOS这样的错误,并没有访问令牌:
I press OK and go back to my iOS with such error and without access token:
(NSError *) $0 = 0x001710f0 Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0x16d4b0 {com.facebook.sdk:ErrorLoginFailedOriginalErrorCode=210}
有效流量:
如果我使用第二(测试)应用程序的应用程序ID / API密钥,我打开我的应用程序,并试图登录。 Facebook的SDK打开本地FB应用程序,并告诉我,屏幕
If I use App ID/API Key from second (test) application, I open my application and trying to login. Facebook SDK opens native FB application and show me that screen
我preSS确定,回到我的iOS与有效的访问令牌。
I press OK and go back to my iOS with valid access token.
应用程序设置都是一样的,我没有看到任何差异。如果我有原生的Facebook应用程序出现此问题。如果我没有它,Facebook的SDK打开浏览器,并授权将是成功的第一和第二的App ID。
Settings of applications are the same, I didn't see any differences. This problem occurred if I have native Facebook application. If I haven't it, Facebook SDK opens browser and authorization will be successful with first and second App ID.
如果有人有这样的问题,请大家帮忙。非常感谢。
If someone had such problem, please help. Thanks a lot.
推荐答案
我解决了这个问题。
改变这里和那里后,其实我发现我的包ID不匹配。我一直包ID同样在以下3个地方,它的工作:
Actually after changing here and there I found my bundle id was not matching. I have kept the bundle id same in the following 3 places and it worked:
- 您的项目捆绑标识符。
- 在FB的A / C的申请命名为iOS版捆绑ID:在头原生iOS应用 。
- 在AppDelegate.m通知字符串值
的NSString * const的FBSessionStateChangedNotification = @yourbundleid:FBSessionStateChangedNotification;
这篇关于不能执行授权给Facebook与iOS SDK和原生的Facebook应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!