如何从 iOS 应用程序使用 Facebook accessToken 以在 Rails / Facebooker 中使用

发布于 2024-09-27 07:52:44 字数 622 浏览 0 评论 0原文

我正在使用 iOS SDK 在 iPhone 应用程序中执行 Facebook Connect,我可以成功登录并从 Facebook 实例获取 accessToken,但我无法从 Rails/facebooker 中使用它。

我在 iPhone 应用程序上进行调用:

NSString * url = [NSString stringWithFormat:@"http://localhost:3000/fb_login?access_token=%@",[self.facebook accessToken],nil];

我将 accessToken 传递给 Rails 应用程序上的操作,如下所示:

#auth_token comes from the iOS SDK.
facebook = Facebooker::Session.create('app_key','secret_key')
facebook.secure!(:auth_token => auth_token)

但我得到 Facebooker::Session::MissingOrInvalidParameter: "Invalid argument"

有什么想法吗?提前致谢。

I'm using iOS SDK to do Facebook Connect in an iPhone application, I can successfully login in and get the accessToken from the Facebook instance but I'm not able to use it from a rails/facebooker.

I do the call on the iPhone app:

NSString * url = [NSString stringWithFormat:@"http://localhost:3000/fb_login?access_token=%@",[self.facebook accessToken],nil];

I'm passing the accessToken to an action on the rails app like this:

#auth_token comes from the iOS SDK.
facebook = Facebooker::Session.create('app_key','secret_key')
facebook.secure!(:auth_token => auth_token)

but I get Facebooker::Session::MissingOrInvalidParameter: "Invalid parameter"

Any thoughts? Thanks in advance.

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

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

发布评论

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

评论(1

人间☆小暴躁 2024-10-04 07:52:44

也许是因为 facebooker 使用旧的 Facebook Connect 身份验证方法。您可能需要使用官方 Facebook gem。

$ gem install facebook

但是,我对 facebooker 不太熟悉,所以我可能是错的!

Perhaps it's because facebooker uses the old Facebook Connect authentication method. You may need to use the official facebook gem.

$ gem install facebook

But, I am not familiar with facebooker specifically, so I could be wrong!

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