Go to http://developers.facebook.com/apps
Setup the necessary information by Clicking on create new app. Get the App Id and App Secret from the site.
Go to https://developers.facebook.com/docs/reference/php/ Install SDK and use it in your code.
Sample Example:
<?php
$api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxx';
$secret = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyy';
include_once './.../facebook.php';
$facebook = new Facebook($api_key, $secret);
$user_profile = $facebook->api('/me');
$friendsinfo = $facebook-> api_client->friends_get();
?>
ASP.NET:
string appId = "---------------";
string appSecret = "--------------------";
string pageId = " ------------------- ";
var fbclient = new FacebookClient();
dynamic result = client.Get("oauth/access_token", new
{
client_id = appId,
client_secret = appDecret,
grant_type = "client_credentials"
});
fbclient.AccessToken = result .access_token;
dynamic parameters = new ExpandoObject();
parameters.title = "title";
parameters.message = "message";
var result = fbclient.Post(pageId + "/feed", parameters);
Setup the necessary information by Clicking on create new app. Get the App Id and App Secret from the site.
Go to https://developers.facebook.com/docs/reference/php/ Install SDK and use it in your code.
Sample Example:
<?php
$api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxx';
$secret = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyy';
include_once './.../facebook.php';
$facebook = new Facebook($api_key, $secret);
$user_profile = $facebook->api('/me');
$friendsinfo = $facebook-> api_client->friends_get();
?>
ASP.NET:
string appId = "---------------";
string appSecret = "--------------------";
string pageId = " ------------------- ";
var fbclient = new FacebookClient();
dynamic result = client.Get("oauth/access_token", new
{
client_id = appId,
client_secret = appDecret,
grant_type = "client_credentials"
});
fbclient.AccessToken = result .access_token;
dynamic parameters = new ExpandoObject();
parameters.title = "title";
parameters.message = "message";
var result = fbclient.Post(pageId + "/feed", parameters);
No comments:
Post a Comment