Go to the Facebook Developers
page and click "Add developer." This is the central location for all your applications on Facebook. You can request as many as 100 API keys from the applications page, as well as manage and change the settings for all your applications. Now that you have added Facebook Developer Application to your account, let's move on to adding your very first application.
Go back to the Facebook Developers
page and click the Set Up New Application
button. This will take you to the "Create Application" page, where you are required to provide the name of your application and, as a rule, agree to certain terms and conditions.
After saving changes to this page, you will be taken to your application's homepage, which serves as your application's edit page. You can change all the settings related to your application here, such as its name, description, icon, logo and much more. You can add more developers if you are going to develop the application in a team.
On the same page, Facebook provides you with an API Key
and a Secret Key
, which are the passports for your application to interact with
Facebook core applications and the outside world. Do not share you secret key with anyone.
To start developing your application, you need to make important changes to the following settings:
- API Key This unique key helps Facebook identify whatever request(s) you make. Enclose this API key along with all your requests.
- Secret Key As mentioned previously, you should keep this key safe and share it with no one, because it is responsible for authenticating your request.
Now, click on the Authentication tab, where you need to specify:
- Post-Authorize Callback URL When a user authorizes your application and adds it to a Facebook account, then Facebook pings this URL. So, this URL needs to be your site's URL where you application is hosted. This cannot be a URL from Facebook.
- Post-Authorize Remove URL When your application is removed by a user, this URL will be pinged along with a post request, which will contain the
User_id. This process allows you to log which user has removed your application.
Now click on the canvas tab, where you need to specify:
- Canvas Page URL Choose a canvas page URL for Facebook, such as http://apps.facebook.com/your-app-name.
- Canvas Callback URL This is the muscle of your application. Facebook pulls the content from this URL and displays it on the application's canvas page. The URL can be where you have your application hosted.
- Render Method You need to selected this option according to your code. If your code is going to have
FBML tags, then you should select "FBML" in this option. Otherwise, leave it default as "iframe" (for this example, you can choose either).
These settings should be enough to get you started with your first Facebook application. Undoubtedly, you can make many other changes to suit your needs in due course.