Facebook Application

posted in: Facebook Development | 0

Summary:

STEPS TO CREATE A FACEBOOK APPLICATION

 

1)  Sign in using Facebook account or create a new Facebook account.

1 A) Once signed in  go to http://www.facebook.com/developers/

and click on “Set up a new app” button to creating face book app, and it is asking for your mobile number for verification. After verified account you can create an application.

clip_image002(1)

We need application name:

 

 

 

2) Once open the facebook screen for the creating application.

clip_image002

We need following details:

Description:

Contact Email: This is required.

Privacy Policy URL: This is optional

Terms of Service URL: This is optional

 

3) Integrating with canvas url and link with your server and your facebook application name insert here.

clip_image003

 

 

 

 

4) After complete the step 2 and step 3 then almost completed then access the details of your facebook application : App Id ,  API Key and facebook canvas URL and facebook application URL.

 

 

Finally we created face book application.

 

Once we complete the above steps it takes few hours to populate our app in facebook.

We can access the app using http://apps.facebook.com/Applicationname.

A Canvas Page is limited to a maximum of 760 pixel in width.

For submitting our application to face book apps directory, our app must have at least 5 total users or 10 monthly active users before you can submit it to the App Directory.

 

Integration with Facebook(PHP Code Intgration):

Using Graph API we need to use following code to integrate PHP code with facebook

This code should be included in all pages.

require ‘facebook.php’;   //This is the graph api file

require ‘global_value.php’; // We get API key and secret

global $Facebook_AppId; // Defined in  global_value.php

global $Facebook_Secret; // Defined in  global_value.php

global $fbme;

global $fbuseruid;

// Create our Application instance (replace this with your appId and secret).

$facebook = new Facebook(array(

‘appId’  => $Facebook_AppId,

‘secret’ => $Facebook_Secret,

‘cookie’ => true,

));

//Facebook Authentication part

$session = $facebook->getSession();

// This code is for Authentication permission when user access our application from FB

$loginUrl = $facebook->getLoginUrl(

array(

‘canvas’    => 1,

‘fbconnect’ => 0,

‘req_perms’ => ’email,publish_stream,status_update,user_birthday,user_location,user_status’

)

);

 

 

To increase the canvas height of facebook app page we need to keep  following code in each page:

<div id=”FB_HiddenIFrameContainer” style=”display:none; position:absolute; left:-100px; top:-100px; width:0px; height: 0px;”>

</div>

<script src=”http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php” type=”text/javascript”></script>

<script type=”text/javascript”>

FB_RequireFeatures([“CanvasUtil”], function(){ FB.XdComm.Server.init(“xd_receiver.htm”);

FB.CanvasClient.startTimerToSizeToContent(); });

</script>

Next Post

Leave a Reply