A Sencha Touch 2 application that allows you to share jogging events with your facebook friends. Original example
Original author - Nick Poulden
- Templates/Template Functions
- Facebook API
- Controllers (References/Actions/Functions)
Setting up JogWithFriends
This demo app shows off how to use Facebook with Sencha Touch. To see the app in action, visit:
In order to run this example app, you'll need to set up a Facebook application and deploy the app to a public server. Below we outline how to do so using free accounts from Heroku and MongoLabs.
Set up Heroku
We assume you're familiar with Git and have it installed.
Visit http://www.heroku.com and sign up.
Download the Heroku command line toolbelt from http://toolbelt.herokuapp.com/
From your command line, type
heroku loginand enter your account details.
Change to the server-side subdirectory of this example.
Set up a git repository:
$ git init
Create a new app on Heroku:
heroku create --stack cedar
Note the URL of your live app.
Set up Facebook
- Visit https://developers.facebook.com/apps and click the 'Create New App' button.
- Fill in the App Display Name and leave the Namespace field blank.
- Note the App ID and App Secret.
- In the 'Select how your app integrates with Facebook' section, click the 'Mobile Web' option and use the domain created for your app on Heroku.
Set up MongoDB
Visit https://mongolab.com and sign up.
In the 'Databases' section, click 'Add'.
Select the 'Free' plan on Amazon EC2, pick a database name, username and password.
Click on your new database and note the connection URL. It should look something like this:
Set up the Sencha Touch app
Fill in your Facebook app ID in the
server-side/app.jsand fill in the config options at the top:
redirect_uriThe Heroku app URL
client_idYour Facebook app ID
client_secretYour Facebook app secret
mongoDbMongo connection URL from above
sessionSecretA random string of characters for session encryption
Running your app locally
To run the app locally, you must first update your Facebook app to point to localhost.
- Visit https://developers.facebook.com/apps and select your application.
- In the 'Select how your app integrates with Facebook' section, click the 'Mobile Web' option
and set the domain to
Next we need to build our app, install the required node modules, and then run the app using node.js.
- Change to the
- Install all the required node modeles by running:
- Run the app by typing:
- Visit your app by going to
Deploying your app
Change to the
Run the following git commands:
$ git add . $ git commit -m "Initial commit" $ git push heroku master
Visit your live Heroku URL from your mobile device or Webkit based browser.