Developing and Deploying with Heroku

I am going to develop this app with Heroku toolbelt. Download the toolbelt and install it in your computer.

https://toolbelt.herokuapp.com

get heroku toolbelt

I am using Ubuntu. If you are using Ubuntu you can use the following wget method to install it. If you are using Windows follow the guidelines in Heroku site. It is very easy to install the toolbelt in any OS.

wget -qO- https://toolbelt.heroku.com/install.sh | sh

install heroku toolbelt

Windows users may skip this step. You should add keys and upload them into Heroku servers.

ssh-keygen -t rsa -f id_rsa
# make sure to remember the passphrase.

adding heroku keys

Now login to Heroku.

Heroku login

login to heroku

Clone the remote git repo into your local folder. This is just getting the source app files in the Heroku server to your computer for editing.

git clone git@heroku.com:morning-ocean-8757.git -o heroku

clone heroku git repo

Now we will edit the index file of the app. I will just edit some lines. You can use any text editor to edit this. notepad, wordpad, dreamviewer, nano, gedit, bluefish, compozer, etc.

edit facebook app files

Put the edited source files back to the server. Browse again to the Facebook App URL. You will see the changes you did to your app index.php file.

https://morning-ocean-8757.herokuapp.com

updated heroku facebook app

Now the app should be added to the page. Use the following URL to add the app to the page tab

https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL

For this particular app it should be as follows.

https://www.facebook.com/dialog/pagetab?app_id=153825634746333&next=https://morning-ocean-8757.herokuapp.com

Select the page you want to add the app. If you don't have a page yet, create one. It is free.

add facebook app to profile tab

Now it is being displayed in your page tabs. Click on tab to visit the app.

facebook app is added to tab

Now the app has been integrated to the page tab.

app on tab

Visit app integrated page tab below.

https://www.facebook.com/pages/PHP-Sri-Lanka/155553284581042?sk=app_153825634746333

Visit original app hosted in Heroku servers below.

https://morning-ocean-8757.herokuapp.com

simple facebook app

This concludes Part 2. Browse the other parts.

Part 1: Simple Facebook Like Gate with Heroku Hosting
Part 2: Developing and Deploying with Heroku
Part 3: Implementing the Facebook Like Gate

No comments:

Post a Comment