I want to count the number of new messages in my facebook account. I looked at facebook mail_box folder and used the below query in the graph explorer.
SELECT name, unread_count, total_count FROM mailbox_folder WHERE folder_id = 0 and viewer_id = me()
The output I got is:
{
"data": [
{
"name": "inbox",
"unread_count": 14,
"total_count": 65
}
]
}
But, I don't find any query related to the counting new messages. So, how can one get the number of new messages.
By new messages I mean the red highlighted pearls in the center foler of this pic.
Good that you included that pic because the question wouldn't have been clear otherwise. The notification pearl for messages does not show the number of unread messages. The notification pearl tells you that you have new messages. Once you click the pearl, even if you don't read the messages, it will reset. This is just from my memory so you should set up some test accounts to verify the behavior. Facebook has made it really easy to set up test accounts by editing your app and then clicking on Roles->Test Users->Create. By opening two browsers (Chrome & Firefox for example) you can be logged in as two separate users and message back and forth to verify the behavior.
If you want to see where the count of 14 unread messages is coming from, do the following:
is:unread (or use the drop-down by clicking the magnifying glass).As far as I know, there is no way to get the number of new messages highlighted in the notification pearl, but the API is big and maybe someone else knows.
The closest thing might be the notifications FQL, but as far as I can see it does not include mailbox notifications. You should verify this on your own since I don't have time at the moment to send a new message between test accounts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With