Showing posts with label creating facebook apps. Show all posts
Showing posts with label creating facebook apps. Show all posts

Thursday, 21 February 2013

Running Facebook apps from localhost

It is possible to develop facebook apps in your localhost be it xampp in windows or LAMP in linux.

Lets make a hello world facebook app  here.

Firstly download a php sdk from here .This allows you to use loads of functions which you needn't worry about defining !!

Paste this in your server (directory) /var/www in LAMP or htdocs in xampp

Now you need to register as a developer and also provide details of your app in facebook , so login to your facebook account and register as developer (look here)


Once you are registered as a developer , go here


Click on create new app, and provide the name of your app, (it has to be unique!)

Then click on continue if your app name is accepted, else try with another name.
After the security check , it allows you to edit the app settings.

 The difference between 'App on facebook' and 'website with facebook login' is that when you select app on facebook , The app runs in a canvas page in facebook itself unlike the other case wherin you login via your facebook account in some other website.

Here inside your /var/www or htdocs you need to create a directory_name folder and paste your codes (.php , .html etc) inside it.

I use something like http://localhost/face/app_name/

'app_name' is a folder inside 'face' , this allows you to have multiple app_name inside face.


Now copy this and save as appname.php inside your directory specified in the Canvas url of facebook app.

The php codes needs you to mention appid ,secret and path to facebook.php (from downloaded sdk)

Run the app in a browser , http://localhost/face/app_name/appname.php.

If it is running you should be able to see your profile pic and other information.


PS:

While developing apps you may need to get permissions on certain user data , for that go to permissions in app settings page.


Enter details in User & Friend Permissions: or  Extended Permissions:


To test these go here



In case you need to install server or create localhost go through this


After these steps if still , the app doesn't  run , check link

Sunday, 15 July 2012

Making a Facebook App

For making a facebook application you need access to server where your code operates,you can however carry on with app development by using your system as the server,localhost.

Facebook accepts only https or secure http so make sure your server can support the same.

To begin with,login to your facebook account and in a different tab open this ,this being a portal for facebook developers.You can later start working by using their tutorial

For now click the create new app tab at the top right corner.An ajax alert like window opens,
Provide an app name,and you have to then provide a unique name in name space which is then used to identify your app.Also in case you do not have hosting facilities,you can sign up for the free hosting at heroku.

Pass the subsequent security check to prove your not a bot.

Then if you encounter "You've been blocked from creating apps because we haven't been able to verify your account" , this means you have to verify yourself by going here the verification requires a government issued id with name, date of birth and photo .Once verified you will be good to start your apps.

Upon success you will be given app id and secret key.

Now in a text editor compose your app code,Then go to app on facebook tab,in the canvas url provide your code file name which you have created in the default localhost folder,The secure canvas requires you to just replace http with https.
Save the changes.

Then visit https://apps.facebook.com/your-app-namespace. viola its your app!!

To develop the app in localhost check out this