So I have a page on facebook that has some tabs via apps that I’ve made. They are promotional tabs. For some of those tabs I’d like to show alternate teaser content until they have “liked” the page. I am NOT using PHP, so JS or Ruby only please.
I do not need to do any fb connect stuff, nor do I need to know if they like the app/page from my website… all of what I need will take place on facebook via iframe.
Thanks!
[edit: check out redbull’s fan page: http://www.facebook.com/redbull this is what I would like to do]
Got a working solution without PHP. Thanks to dwarfy at this post for inspiration.
This is NOT a JS solution, and I don’t think that what I am interested in doing can be done with JS because it would involve cross-site scripting, which is a no-no. In short, you have to digest
signed_requestin one way or another if you want to tell if someone likes your page via your iframed app.So my app is Ruby on Rails. On the FB side I kept things in sandbox mode and worked/tested in prod. Not sure how to get a suitable local environment to test. anyway…
rails g controller gate index fbindexapp/controllers/gate_controller.rb:
app/views/gate/index.html.erb:
app/views/gate/fbindex.html.erb:
Get your FB settings right:
