Send notification to user from application via notification API

I want to send a notification from the application through the notification API to the authenticated user of my application. Can someone help me with this? Any help would be appreciated.

Let's say I want the user to be notified when certain events occur in my application.

Thanks in advance

+7
source share
1 answer

I found my solution myself. The developer must complete the following steps:

the code:

require_once "facebook-php-sdk/facebook.php"; $facebook = new Facebook(); $app_id = YOUR_APP_ID; $app_secret = YOUR_APP_SECRET; $app_access_token = $app_id . '|' . $app_secret; $response = $facebook->api( '/RECEIVER_USER_ID/notifications', 'POST', array( 'template' => 'You have received a new message.', 'href' => 'RELATIVE URL', 'access_token' => $app_access_token ) ); print_r($response); 

If everything works fine, you will get the following result:

 Array ( [success] => 1 ) 
+27
source

All Articles