Tuesday, November 22, 2011

Create Facebook Apps

Easy and simple Steps to create a facebook apps

1. Login to your facebook account and open the url : http://developers.facebook.com

Click on Build Apps on Facebook
   
Now Click on Apps tab on top

Now Facebook ask request for permission .. click allow button to allow your apps to create on facebook



Now you are ready to create an application on facebook. Click on create apps tab

Add an App display name : eg . test and continue

Add the captcha code and submit
Your application is created and you get an api and secret key for your apps like this below

######### (if you have your own domain and hosting) ############


App Display name : It defines the name of application show to this application profile page
App Namespace: It defines a name shown in url of canvas url path eg. apps.facebook.com/tedfgdfg
Note : app namespace must be in small letters 
Contact Email: email id of developer eg. testing@yahoo.com
App Domain : url of your domain : eg. testing.com, example.org .. etc type without using www ot http and press enter your app domain will be added.

Select your apps to create of facebook

Website Url path : http://www.testing.com is a url path of that website which you are using for facebook domain and hosting.

App on facebook:
Canval Url : http://testing.com/ ... the name of this path must contain an ending slash / or and query strings.
eg. for canvas url :
http://testing.com/test/
http://testing.com/index.php?
http://testing.com/test/home/login.aspx?id=1&name ... etc

Secured Canvas Url : must start with https ....
eg. https://testing.com/ , https://testing.com/index.php? ... so on

Canvas Page is a page where your application runs
eg.  
1.  http://apps.facebook.com/tedfgdfg this url is created by default if you are using non secured browser 
For setting  non secured browsing you need to update your facebook account settings as below



2. https://apps.facebook.com/tedfgdfg is for secured browsing for secured browsing your hosting provider must be ssl enabled ..... else your apps will not work on secured browsing.

######### (if you dont have your own domain and hosting) ############

Using Cloud Services :

click on get started


Select the environment on which you want to create apps Heroku provides following four environment :
PHP, Node,js, Python and Ruby
Now you url is successfully created ... click on go to apps and learn how to create apps on facebook using cloud services

Errors Occurs While Creating Facebook apps
After Creating your application when you open you application
For eg. http://apps.facebook.com/testing 
Your url path is shown to the facebook iframe page and following errors may occur

while creating  an iframe for my Facebook page. However, encounters an error that goes like this:


a. The page cannot be displayed - 404 error
b. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access. - 405 error

c. Time out error - 503 error



The solution  for iis below 7 version
 HTTP Error 405 - The HTTP verb used to access this page is not allowed.
1. Start –> Run –> inetmgr
2. Websites –> website/domain name in question
3. Right Click on the domain –> Properties –> Home Directory –> Configuration
4. In the tab Mappings –> Add an extension for .html and .htm , if it is missing (most cases it will be missing) and edit to add all verbs (POST, GET, HEAD are needed)
5. Fields to be added are as below,


Executable : C:\WINDOWS\system32\inetsrv\asp.dll
Extension : .html
Limit to : GET,HEAD,POST,TRACE

The solution  for iis 7.5

You had an index.php file,  change your default document to index.php or index.aspx and your site now resolves without any problem.


I found this solution at the below link and being that you already had the index.php it was just a matter of setting the site to look at the index.php before the index.html.


--------------------------------------------------------------------------------


Please try the following:


•Contact the Web site administrator if you believe that this request should be allowed.
•Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly. 
HTTP Error 405 - The HTTP verb used to access this page is not allowed.
Internet Information Services (IIS)

Error messages from this server (error 405 - HTTP verb or similar)


" If your server returns an error when Facebook tries to load the HTML page into the iFrame, you may need to change the file extension from .html to .php or .aspx (depending on the server platform you are using). When Facebook loads the iFrame, they do a POST to the index page in order to pass some data to your application and it looks like some servers are set up to not allow a POST to a file with the .html extension. We will be taking a look at how to access the data that Facebook passes in the next tutorial, but I wanted to mention this now since it caused issues for some people. "


Changed the "index.html" file into "index.php" on  hosting and it works like a charm.


Many times page not displayed error occurs if you create your apps using capital letter 


Eg. http://apps.facebook.com/Tesinghttp://apps.facebook.com/TESTING  will not work facebook does not accept capitals letters .....
only small letters are allowed so try changing your app namespace for such conditions








2 comments: