ruby-on-railsfacebookruby-on-rails-3facebookerfacebooker2

Multiple Facebook apps with Facebooker2


I'm working on a rails app that powers multiple facebook apps (serving them via iFrame) and allows users to install / customize the different apps from an admin area in my app.

I'm using the Facebooker2 gem and noticed that I can only specify one app_id and app_secret in the Facebooker.yml config file. Any tips on how I can modify it to support multiple Facebook apps.

My first thought would be to store the app_id's and app_secret's for my apps in the database then have Facebooker dynamically load them accordingly from there.

Any advice would be much appreciated!


Solution

  • Well I have worked on this problem before, the way we did it was to store the facebook credentials in a database, depending on the customer we had a before_filter in our controller which would switch the configuration as needed. I hope this helps as a starting point. I can elaborate more if you need me to.