在 iframe 应用程序中使用 Facebooker 获取嵌套 iframe

发布于 2024-08-06 07:52:18 字数 440 浏览 3 评论 0原文

有人在 Rails/Facebooker 应用程序中遇到过嵌套 iframe 吗? 基本上,每次我单击某个操作或链接时,整个 facebook 页面都会在我现有的 iframe 内重新加载,导致出现两个(每次后续单击时会出现更多)facebook 边框。

我已经将说明检查了三遍,并更改了所有可以想象的设置,但该应用程序仍然在 iframe 内的新 Facebook 页面中打开。有人有什么想法吗?

它仅在我使用

ensure_application_is_installed_by_facebook_user

过滤器时出现,但如果用户已经安装了该应用程序并且我使用了

ensure_authenticated_to_facebook

过滤器,它就可以正常工作......非常奇怪(至少对我来说)

Has anyone encountered nested iframes in their Rails/Facebooker application?
Basically, every time I click an action or link, the entire facebook page reloads inside my existing iframe, causing two (and more on each subsequent click) facebook borders to appear.

I've gone over the instructions three times and changed every setting imaginable, but the app still opens up in new facebook page inside the iframe. Any ideas anyone?

itonly appears when I use the

ensure_application_is_installed_by_facebook_user

filter, but if the user already has the application installed and I use the

ensure_authenticated_to_facebook

filter, it works fine...very strange (to me at least)

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

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

发布评论

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

评论(2

早乙女 2024-08-13 07:52:18

事实证明,由于 Facebook API 的更改,ensure_application_is_installed_by_facebook_user 已被弃用。
我计划很快用这些信息更新 Facebooker 文档。

Turns out ensure_application_is_installed_by_facebook_user is deprecated because of a change in Facebook's API.
I plan to update the Facebooker documentation with this information soon.

柠檬 2024-08-13 07:52:18

我在嵌套 iframe 中遇到了同样的事情,所以我使用“ensure_authenticated_to_facebook”代替。唯一的问题是,用户安装应用程序后,它会将他们重定向到我的域,而不是 facebook iframe 页面。在 facebooker 中做了一些调整后,我决定在这个方法中硬编码 :canvas=>"true" ,该方法位于 lib/facebooker/rails/controller.rb 第 189 行,

def create_new_facebook_session_and_redirect!
      session[:facebook_session] = new_facebook_session
      next_url = after_facebook_login_url || default_after_facebook_login_url
      #top_redirect_to session[:facebook_session].login_url({:next => next_url, :canvas=>params[:fb_sig_in_canvas]}) unless @installation_required
      top_redirect_to session[:facebook_session].login_url({:next => next_url, :canvas=>"true"}) unless @installation_required
      false
end

我在我的博客中写了一个关于此修复的教程 - http://railsrant .com/2009/10/14/creating-a-facebook-iframe-app-using-ruby-on-rails-facebooker/

I experienced the same thing with nested iframes, so I used "ensure_authenticated_to_facebook" instead. The only gotcha was that after the user installed the app, it would redirect them to my domain and not the facebook iframe page. After doing some tweaking in facebooker, I decided to hard code :canvas=>"true" in this method which is in lib/facebooker/rails/controller.rb line 189

def create_new_facebook_session_and_redirect!
      session[:facebook_session] = new_facebook_session
      next_url = after_facebook_login_url || default_after_facebook_login_url
      #top_redirect_to session[:facebook_session].login_url({:next => next_url, :canvas=>params[:fb_sig_in_canvas]}) unless @installation_required
      top_redirect_to session[:facebook_session].login_url({:next => next_url, :canvas=>"true"}) unless @installation_required
      false
end

I wrote a tutorial on this fix in my blog - http://railsrant.com/2009/10/14/creating-a-facebook-iframe-app-using-ruby-on-rails-facebooker/

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