Facebook Notification using Facebook php sdk


Hi,

For add Facebook notification api using facebook php sdk

require_once( 'facebook.php' );/*noLibHook*/
$fbapi = FACEBOOK_API;
$fbsecret = FACEBOOK_SECRET_KEY;
$facebook = new Facebook(
array( 'appId' => $fbapi,
'secret' => $fbsecret,
'cookie' => true
));

$user_id = FACEBOOK_USER_ID;
$template = "Hi Message";

$param = array(
'template' => $template,
'href' => 'http://google.com',
'access_token' => $facebook->getAccessToken(),
);

$facebook->api("/$user_id/notifications", "POST", $param1);

Facebook notification api just work with canvas facebook application/page.So please Add Canvas url of App in App of Facebook Setting.

thanks

Advertisements

3 responses to “Facebook Notification using Facebook php sdk

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s