Notification (FQL)
From Facebook Developer Wiki
Contents |
Description
The FQL notification table. Query this table to get the notifications for the current session user, that is, any notification that appears on http://www.facebook.com/notifications.php. You can identify app-to-user notifications because for those notifications, both the sender_id and the recipient_id contain the same user ID.
Facebook deletes notifications older than 7 days, so only notifications less than a week old get returned in a query on this table.
For Facebook applications (like Photos or Wall), the notification is always sent in the user's language and locale that were set at the time the notification was sent.
To structure your query, use the table name (notification in this case) in the FROM clause. The items in the Name column correspond to columns in the table that can be referenced in the SELECT and WHERE clauses.
In order to make your query indexable, the WHERE clause in your query should contain an = or IN clause for the recipient_id column.
The See Also section lists API functions that work on similar data.
Columns
| Indexable | Name | Type | Description | |
| notification_id | int | The ID of the notification. This ID is not globally unique, so the recipient_id must be specified in addition to it. | ||
| sender_id | int | The user ID of the sender of the notification. | ||
| * | recipient_id | int | The user ID of the recipient of the notification. It is always the current session user. | |
| created_time | time | The time the notification was originally sent. Notifications older than 7 days are deleted and will not be returned via this table or notifications.getList. | ||
| updated_time | time | The time the notification was originally sent, or the time the associated application's notifications were hidden or unhidden by the user, whichever is later. | ||
| title_html | string | The main body of the notification in HTML. | ||
| title_text | string | The plaintext version of title_html, with all HTML tags stripped out. | ||
| body_html | string | Any additional content the notification includes, in HTML. | ||
| body_text | string | The plaintext version of body_html, with all HTML tags stripped out. | ||
| href | string | The URL associated with the notification. This is usually a location where the user can interact with the subject of the notification. | ||
| app_id | int | The ID of the application associated with the notification. This may be a third-party application or a Facebook application (for example, Wall). | ||
| is_unread | bool | Indicates whether the notification has been marked as read. Use notifications.markRead to mark a notification as read. | ||
| is_hidden | bool | Indicates whether the user hid the associated application's notifications. |
Examples
Retrieves <uid>'s notifications that are not hidden, are unread, and were created after <time>.
Notes
- For an example of the table being used to pop up real-time notifications, see the Facebook for Adobe AIR application.
- I filed bug 6799, which describes how body_text returns HTML markup in the field and body_html returns escaped markup.
