Can't send FB Notifications with new API

Posted by Zak Khalique on Stack Overflow See other posts from Stack Overflow or by Zak Khalique
Published on 2012-11-07T04:02:55Z Indexed on 2012/11/07 5:00 UTC
Read the original article Hit count: 2115

Filed under:
|

Really need some help with this one!

I'm trying to send notifications from a canvas app using the new notifications API but I keep getting the following exception:

OAuthException: (#200) Only web canvas apps can send app notifications

However, the app IS loaded in the Facebook canvas -- I'm making an ajax call to my server when the user takes a particular action which triggers the notification POST request. The user has also authorized the app.

This is the code I'm using:

$graphUrl = $user_id . "/notifications";
$params = array( "access_token" => $admintoken,
             "href" => $link, 
         "template" => "string of text < 180 chars"
        );

try {
  $result = $facebook->_graph($graphUrl, 'POST', $params);
 } catch (Exception $e){
     echo $e;
 }

© Stack Overflow or respective owner

Related posts about facebook

Related posts about notifications