Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How mark a Facebook notification as read via Facebook API?

I have managed to get a list of new Facebook Notifications but can't seem to find a way of marking them as read?

I am using FQL with the PHP SDK.

Please can someone point me to some documentation with examples.

like image 584
pjknight Avatar asked Dec 22 '25 00:12

pjknight


1 Answers

To mark a notification as read, POST to

graph.facebook.com/NOTIFICATION_ID 

with param "unread"=0.

If you've received the notification object via Grapth API, NOTIFICATION_ID equals the id of the notification object.

If you've received the notification object via FQL, you'll have to build NOTIFICATION_ID as follows:

"Notif_" + userId + "_" + notification_id.

For example if current userId is 123 and notification_id from FQL is 456, NOTIFICATION_ID should be:

notif_123_456 

and the POST becomes:

graph.facebook.com/notif_123_456

with parameter unread=0

You'll need 'manage_notifications' permission.

like image 143
onosendai Avatar answered Dec 23 '25 22:12

onosendai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!