0

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: enter image description here

squiter
  • 5,711
  • 4
  • 24
  • 24

4 Answers4

2

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

0

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?

Jonathan Dean
  • 1,112
  • 7
  • 9
  • The tab only shows a blank page. There is no content inside the iFrame and my app is not in sandbox mode. – squiter Jul 11 '12 at 19:54
  • Your page tab edit Url is also invalid, but I don't think that is causing the issue. Could you try another Heroku app with "-" in the name? It may be causing the issue? – Jonathan Dean Jul 12 '12 at 17:14
  • What can I add in Page Edit Tab URL?? I don't think the issue is caused by the "-" because if you create a heroku app into facebook, the app's name have the "-" too. – squiter Jul 12 '12 at 17:33
  • You can remove the value from "Page Tab Edit URL" at all. – Jonathan Dean Jul 13 '12 at 11:13
  • @BrunnoDosSantos This post (http://stackoverflow.com/questions/8034356/canvas-url-secure-canvas-url-error-message) might help. It looks like you need to set the "Secure Canvas Url" not the "Secure Page Tab url". – Neil Jul 13 '12 at 13:11
  • @Neil I tried to change the configs to use Canvas App, but I get the same error... a blank page. To Facebook, my app do not return anything. =( – squiter Jul 13 '12 at 15:08
0

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
Igy
  • 43,710
  • 8
  • 89
  • 115
  • Thanks to reply @Igly. I changed my app configs and changed the return of my POST route in Sinatra, if you check my URL again, you'll see the response, but it still no working in facebook pages tab. – squiter Jul 11 '12 at 20:51
  • did you fix the page tab url setting? – Igy Jul 11 '12 at 21:12
  • Yes I fix. The 'Site URL' and 'tab site url' whith http. Screenshot here: http://cl.ly/2t3U0G3j2L1T2e3p2w0M – squiter Jul 11 '12 at 21:18
0

"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

igor
  • 21
  • 3