Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
95 lines (58 sloc) 3.62 KB
Basic app structure
This canvas app is intended to run within a Facebook page. When clicking onto the app, anonymous (not authenticated) users see a page with explanation and a button to signup (as a fundraiser).
Once authenticated, they see a slightly modified page with share/tweet/donate buttons.
The only other page is the donate page. The app generates a special URL that the user can share with friends. Any donation made via that URL increases their leadboard total.
The special donate URL actually points to the application via the Facebook page so it's a pretty long unwieldily URL but it does mean that everyone stays within the UNICEF Facebook page environment.
The donate form is just a dummy form and just increments the fundraisers total. The next major step is to replace this with a real paypal button/form that ties the donation, when made, to the fundraiser.
Live demo:
There is a live demo page running here:
Things that don't work
* Real donations
* The tell a friend button (which is supposed to open a facebook 'send' dialog) stopped working at some point and I can't figure out why
Deploying to Heroku
At the moment, things are written such that each facebook page using the app needs it's own deployment. This obviously isn't ideal. In the future the app should detect each facebook page install and create a new leaderboard for users scoped to that local UNICEF fund page.
Instructions for deploying to heroku:
(assuming a local clone from the github repository, heroku account, heroku gem installed etc)
cd tinyboxes/
heroku create
git push heroku master
Create a Facebook app:
These are the important settings:
(Assuming heroku app name is tiny-boxes-123...)
Site URL:
Site Domain:
Canvas URL:
Tab URL:
Configure the Heroku app for your Facebook page:
heroku config:add FB_APP_ID=<your fb app id> FB_APP_SECRET=<your fb app secret>
(e.g. if page doesn't yet have a username:)
heroku config:add FB_PAGE_NAME="pages/Tiny-Boxes-Test-Page/1080403234234"
(e.g. when page has a username:)
heroku config:add FB_PAGE_NAME="unicef"
... eventually the same configuration mechanism should be used to specify the paypal account that's going to receive donations and the locale to use (when internationalised).
Add the app to the facebook page
* Find the application "page" on facebook (the page that has a wall etc - it's not the actual app)
* You'll find a link to add the app to a page
* Update config/locales/en.yml with real text
* Working paypal button/form on donate page
* Use paypal Instant Payment Notifications api to match payments to origin user
* Create shorter donation URLs that redirect to the long in-facebook-page donation urls (maybe using bitly api)
* When visitor comes to the app via a donate link, allow visitor to navigate around app (to get more info), before returning to donate page. Maybe store donate\_token in a cookie or pass donate_token around via query params
* Make the app installable on multiple pages, supporting separate leaderboards.
* i18n - we're using standard Rails localisation features so this shouldn't be too hard