本文介绍了如何通过Facebook API读取Facebook通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设法得到一个新的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

请有人指点一些文档的例子。

Please can someone point me to some documentation with examples.

推荐答案

要将通知标记为已读, POST到

To mark a notification as read, POST to

graph.facebook.com/NOTIFICATION_ID

与param 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成为:

graph.facebook.com/notif_123_456

参数 unread = 0

你'需要'manage_notifications'权限。

You'll need 'manage_notifications' permission.

这篇关于如何通过Facebook API读取Facebook通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 01:18