问题描述
我有什么和发生什么问题:
- 我有一个Facebook帐户与游戏应用程序(每天人们玩)
- 我还有一个Facebook测试应用程序,最近创建了默认设置。
- 我在我的iPod上有原生的Facebook应用程序
- 我正在开发使用Facebook iOS SDK的iOS应用程序。
流量无效: p>
如果我从第一个应用程序使用App ID / API Key,我打开我的应用程序并尝试登录。 Facebook SDK打开本机FB应用程序,并向我显示屏幕
我按OK,回到我的iOS,出现这样的错误,没有访问令牌:
(NSError * )$ 0 = 0x001710f0错误Domain = com.facebook.sdk代码= 2操作无法完成(com.facebook.sdk错误2.)UserInfo = 0x16d4b0 {com.facebook.sdk:ErrorLoginFailedOriginalErrorCode = 210}
有效流程:
如果我使用App从第二(测试)应用程序的ID / API密钥,我打开我的应用程序并尝试登录。 Facebook SDK打开本机FB应用程序,并向我显示屏幕
我按确定并返回到我的iOS有效的访问令牌。
应用程序的设置是一样的,我没有看到任何差异。如果我有原生的Facebook应用程序,就会出现此问题如果我没有,Facebook SDK打开浏览器,授权将成功与第一和第二个应用程序ID。
如果有人有这样的问题,请帮助。非常感谢。
我解决了这个问题。
改变这里和那里后,我发现我的包ID不匹配。我已经在以下3个地方保持捆绑ID相同,它的工作原理是:
- 项目的捆绑标识符。
- 在您的FB a / c中,在iOS iOS应用程序下面命名为iOS软件包ID。
- AppDelegate.m
中的通知字符串值
NSString * const FBSessionStateChangedNotification = @yourbundleid:FBSessionStateChangedNotification;
What I have and what're problems occurred:
- 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.
Invalid flow:
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
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}
Valid flow:
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
I press OK and go back to my iOS with valid access token.
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.
I solved the issue.
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:
- The bundle identifier of your project.
- In your FB a/c the filed named "iOS Bundle ID:" under head Native iOS App.
- The notification string value in your AppDelegate.m
NSString *const FBSessionStateChangedNotification = @"yourbundleid:FBSessionStateChangedNotification";
这篇关于使用iOS SDK和本机Facebook应用程序无法向Facebook发送信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!