Facebook Notification using Facebook php sdk


For add Facebook notification api using facebook php sdk

require_once( 'facebook.php' );/*noLibHook*/
$fbapi = FACEBOOK_API;
$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.



Facebook Share URL

Hello  guys,

Normally we use

<a href="http://www.facebook.com/sharer.php?u=http://yoururl.com&t=your title here target="_blank">Facebook Share</a>

but sometime it not take title from the variable t . For solve this issue you can use

<a href = "http://www.facebook.com/sharer.php?s=100&p[title]=titlehere&p[url]=http://www.yoururlhere.com&p[summary]=your
sumary&p[images][0]=http://www.urltoyourimage.com"  target="_blank">FacebookShare</a>
p[title] => title want to share
p[url] => url want to share
p[summary] = summmary want to share
p[images][n] = images want to share. images may be multiple (n number).