The app I'm making needs to monitor the Inbox for new messages. As far as I am aware, there is no way yet for the GMail API to push a notif to me when a user has a new message (Push notification for new gmail).
I could check every minute for new messages by using the history IDs. Is that the current best method outside of implementing a full IMAP solution (which would no longer be utilizing the GMail API)?
The most efficient Gmail API method would be to use history.list(). Specify a
labelId
of Inbox (so you're not seeing updates on other labels) and ahistoryId
of whatever the largesthistoryId
you've previously seen is (you'll need to track this). If you get back a 404 error, you'll need to use messages.list() instead to perform a full sync.