ArtStyle ArtStyle - 1 year ago 110
iOS Question

Get number of unread messages via Gmail API

This sample allows me to fetch some labels from Gmail interface. The question is: Is it possible to fetch the number of a user's unread messages in Gmail, using the same tools in the sample?

Answer Source

I'm not very good at objective-c, but you can get every message with the UNREAD-label and check the unread count:




 "id": "UNREAD",
 "name": "UNREAD",
 "type": "system",
 "messagesTotal": 354,
 "messagesUnread": 354,
 "threadsTotal": 320,
 "threadsUnread": 320

As you can see, messagesUnread tells me I have 354 unread messages.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download