iOS SDK:未经授权的 Feed 对话框被发送到 Facebook 主页

发布于 2024-12-05 21:52:21 字数 979 浏览 1 评论 0原文

我遇到了一个有趣的错误,只是想知道是否有人遇到过同样的问题(因为我在谷歌搜索了 2 小时后找不到任何相关信息):

我像这样初始化 facebook SDK(最新版本 23.September2011):

facebook = [[Facebook alloc] initWithAppId:FACEBOOK_APP_ID andDelegate:self];

之后,我想在没有授权对话框的情况下向用户 Wall 发送一些信息:

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
     FACEBOOK_APP_ID, @"app_id",
     @"http://itunes.apple.com/de/app/idxyz", @"link",
     @"http://example.com/app_icon90px_d_p_i_g.png", @"picture",
     @"AppName", @"name",
     @"awesome new App. Look at it. Yadda Yadda Yadda", @"caption",
     @"Here's an even more interesting description", @"description",
     nil];

[facebook dialog:@"feed"
        andParams:params
      andDelegate:self];    

会发生什么: Facebook 对话框打开并询问用户电子邮件和密码。酷,到目前为止一切都很好。但是,如果我向系统提供我的电子邮件和密码,它不会变回“post-to-wall”对话框,而是显示 facebook 用户/主页。如果您现在中止对话框并调用上面的方法,它将直接进入提要对话框。首先通过 Facebook 验证应用程序的解决方法不是解决方案:-(

I ran into an interesting bug and just want to know if anyone did experience the same problem (since I couldn't find anything about it after 2h of google):

I initalize the facebook SDK (newest Version 23. Sept 2011) like this:

facebook = [[Facebook alloc] initWithAppId:FACEBOOK_APP_ID andDelegate:self];

Afterwards, I want to send some information to the users Wall without the authorization dialog:

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
     FACEBOOK_APP_ID, @"app_id",
     @"http://itunes.apple.com/de/app/idxyz", @"link",
     @"http://example.com/app_icon90px_d_p_i_g.png", @"picture",
     @"AppName", @"name",
     @"awesome new App. Look at it. Yadda Yadda Yadda", @"caption",
     @"Here's an even more interesting description", @"description",
     nil];

[facebook dialog:@"feed"
        andParams:params
      andDelegate:self];    

What happens: The Facebook dialog opens and asks for the user email and password. Cool, everythings fine till yet. But if I provide the system with my email and password it doesn't change back to the post-to-wall dialog but instead shows the facebook user/home page. If you abort the dialog now and recall the method above, it goes directly to the feed-dialoge. The workaround to authenticate the app with facebook first is no solution :-(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

琉璃繁缕 2024-12-12 21:52:21

现在是 2012 年 5 月,我遇到了类似的问题,用户已经通过 SSO 进行了身份验证,但当我调用 feed 对话框时,它会弹出带有登录页面的 Web 模式,而不是正常的 feed 对话框。

原来是 Facebook 服务器问题,经过一天的令人揪心的调试后,我无法再次重现该问题。

更多详细信息:
我不请求 offline_access 因为它将于 7 月被弃用。因此,起初我认为这就是我的会话过期的原因,并检查了有关在 applicationDidBecomeActive 中自动扩展令牌的所有内容。但问题仍然存在。

然后,我什至打印出令牌并使用浏览器上的 graph.facebook.com/me/permissions 调用检查令牌的有效性!

那天,该对话框有几次只返回一个错误,提示“出现错误,请稍后再试”。所以就在那时我决定放弃它,第二天再试一次,它就成功了!

It's May 2012 now and I experienced similar problem where the user already authenticated via SSO but when I call the feed dialog, it pops up the web modal with a login page instead of the normal feed dialog.

Turn out it's Facebook server issue and I can't reproduce the issue again after that hair-pulling one day debug.

More details:
I don't request for offline_access because it is going to be deprecated in July. So at first I thought that's the reason why my session expired and I checked everything regarding automatic extending the token in applicationDidBecomeActive. But the problem still exists.

I then even print out the token and check the validity of the token using graph.facebook.com/me/permissions call on the browser!

A few times during that day, the dialog just return an error saying "There's error, try again later". So that's when I decided to leave it and try again the next day and it just worked!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文