Facebook Page Tab doesn't show my content

2019-09-09 12:53发布

问题:

I'm trying to show some html in a facebook tab page without success.... I'm new in facebook applications and I do not understand what is happening.
I've created a heroku app, to use your SSL, named https://sinatra-dev-test.herokuapp.com, this URL only shows a H1 with a "Teste" string.
In my Sinatra Application I have a get route, and a post route that redirects to get.
The heroku logs do not show nothing in particular, no one error or warning.

Here is a screenshot to my facebook app config:

回答1:

Sinatra has a protection for frame by default.

You need to use this:

set :protection, except: [:frame_options]

At your app.rb

This will allow you to use your website as a iframe. Read more at http://www.sinatrarb.com/intro.html#Configuring%20attack%20protection



回答2:

Are you seeing any error message when you try and view the app in the tab? Is your app in sandbox mode by any chance?



回答3:

Your 'secure page tab URL' and 'page tab URL' are both set to a HTTPS URL - you need the 'page tab URL' to be a HTTP URL.

Additionally, your server isn't processing a POST request correctly (or at least, is returning a blank page when I try) - the page load from Facebook will be a HTTP POST request with a signed_request parameter which gives your app details about the page and user currently loading the app

curl -i -F 'test=test' http://sinatra-dev-test.herokuapp.com
HTTP/1.1 100 Continue

HTTP/1.1 303 See Other 
Content-Type: text/html;charset=utf-8
Date: Wed, 11 Jul 2012 20:29:58 GMT
Location: http://sinatra-dev-test.herokuapp.com/
Server: WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
X-Frame-Options: sameorigin
X-Xss-Protection: 1; mode=block
Content-Length: 0
Connection: keep-alive


回答4:

"Your 'secure page tab URL' and 'page tab URL' are both set to a HTTPS URL - you need the 'page tab URL' to be a HTTP URL."

igy, it's not necessary to be in 'page tab URL' a HTTP URL