mardi 31 mars 2015

Facebook app notification template with user id ( @[user_id] ) not working

I can't get the @[user_id] template to work using:



$userid = <USER_ID>;
$friendId = <FRIEND_ID>; // This is a user who has accepted the app
$url = "http://ift.tt/1Bhlqca";
$attachment = array(
'access_token' => "$app_token",
'href' => "",
'template' => "@[" . $friendId . "] accepted challenge!"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
//curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
curl_close ($ch);


$result returns 'false'


$friendId is a valid app user and $app_token is "appid|appsecret"


If I replace 'template' with a simple message such as "test" it all works fine


Any ideas?


Aucun commentaire:

Enregistrer un commentaire