Thursday, 13 June 2013

Creating Facebook Application

Hi,

how to kick start with creating and running  first Facebook application?

       The most easiest thing to do on Facebook is viewing an app created by some one and posting/sharing the result on our wall.

Have you ever wondered how to create a app like that ??? (Now think!!!)

       Well, I agree its not very easy for the first time, but if you follow this blog you can run your first Facebook  application. (believe me You can!)


       You should have little knowledge about PHP,Java Script and MySql for this...

      Though we can develop an app using ruby,c# etc I prefer PHP (As i know this better ;) )


Now lets start,

   1. Go to developers.facebook.com and click on apps (Before this you should log on to Facebook)

   2. And click on apps option at top of the windows, you will be presented with a page create or edit your apps.
  
   3. Click on +Create New App, a dialgoue bar appears
 
   4. Give your app a name and Select Yes, I would like to use free webhosting by Heroku
                        (Heroku provides free webhosting for fb apps)



Creating & running facebook application, editing fb app, facebook application, git, gitbash, Heroku, php sdk for facebook development, view fb app, webhosting,

   5. click on continue, you will get a dialogue box like this

6. Select the environment you have to work on, I prefer PHP but hosting on heroku supports  many Environments..             Provide your email id and click create

7. Some fields will be filled automatically, if you are hosting on heroku rather than on your own site then select app on       facebook, the canvas url will be your App url..

8. click on save changes, Now your app has been configured and launched on heroku. goto the App url, you could see     your app running..

    cheers you have your app running !!!

   Do you like to edit it??? Then download the git bash belt from here which is used to get your App
   source code from heroku and edit locally and upload again

9. Once you install gitbash, open it and type following commands

                        //you have to do this everytime, first you should login to heroku
                        heroku login

                        // enter your username and password which you entered when the heroku account was created
                        //app creation
                        // Now you need to fetch your app source code to edit locally
                        git clone git@heroku.com:your_app_name.git -o heroku

                        //This will create a folder in your documents by your app name

                        // now navigate to that folder
                        cd  your_app_name

                        now got your app folder, open in any IDE and edit and save
                        now you have to upload the edited source code back on heroku, to do it

                        git commit -am

                        this will save your changes

                        git push heroku

                        this will update your source code on heroku and you can see your changes now, goto your app url
                        you can see your changes

                        what if you want to add any extra file as part of your app development

                        git add file_name

                        this will add file_name to be tracked :)

You are done. That's all... Continue with editing your app, saving it and pushing it on to heroku server..

Happy blogging :)

Any doubts please feel free to comment :)

No comments:

Post a Comment