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