I get all my 'UNREAD' messages with listMessages(), change label with modifyMessage() and publish them on Redis channel via publish() method.
But I asking for new message every minute.
How can I get notified by google when a new message arrives so I don’t have to poll every minute? I check "Push Notifications" in google doc, but can`t figure how should I done.
Could somebody explain me with simple words??
Thanks!
The Push notification in Gmail API let you watch for changes to Gmail mailboxes. You can use this feature to improve the performance of your application. It allows you to eliminate the extra network and compute costs involved with polling resources to determine if they have changed. Also, it will lessen your quota usage.
But take Note that for notifications to user-owned devices (i.e. installed apps, mobile devices, or browsers), the poll-based sync guide is still the recommended approach to retrieve updates.
This documentation will help you on how to implement and work with the push notification, including how to receive it and respond with it.
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