如何通过 Facebook API 将 Facebook 通知标记为已读? [英] How mark a Facebook notification as read via Facebook API?
问题描述
我设法获得了新的 Facebook 通知
列表,但似乎找不到将它们标记为已读的方法?
I have managed to get a list of new Facebook Notifications
but can't seem to find a way of marking them as read?
我将 FQL
与 PHP SDK
一起使用.
I am using FQL
with the PHP SDK
.
请有人指点我一些带有示例的文档.
Please can someone point me to some documentation with examples.
推荐答案
要将通知标记为已读,POST 到
To mark a notification as read, POST to
graph.facebook.com/NOTIFICATION_ID
带参数"unread"=0
.
如果您通过 Grapth API 收到通知对象,则 NOTIFICATION_ID 等于通知对象的 ID.
If you've received the notification object via Grapth API, NOTIFICATION_ID equals the id of the notification object.
如果您已通过 FQL 收到通知对象,则必须按如下方式构建 NOTIFICATION_ID:
If you've received the notification object via FQL, you'll have to build NOTIFICATION_ID as follows:
"Notif_" + userId + "_" + notification_id.
例如,如果当前 userId 为 123,FQL 中的 notification_id 为 456,则 NOTIFICATION_ID 应为:
For example if current userId is 123 and notification_id from FQL is 456, NOTIFICATION_ID should be:
notif_123_456
然后 POST 变成:
and the POST becomes:
graph.facebook.com/notif_123_456
带参数unread=0
您需要manage_notifications"权限.
You'll need 'manage_notifications' permission.
这篇关于如何通过 Facebook API 将 Facebook 通知标记为已读?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!