How to receive push notifications from my Gmail account?

前端 未结 3 791
长情又很酷
长情又很酷 2021-02-20 11:37

I\'d like to write an application which monitors a mailbox (ideally a Gmail mailbox). In brief, my question is how do I listen to incoming emails? I could always keep pulling em

3条回答
  •  孤独总比滥情好
    2021-02-20 12:12

    If you just want to talk to Gmail, they have a REST API you can use and it supports push notifications (e.g. webhooks): https://developers.google.com/gmail/api/guides/push

    But again this is a Gmail-specific API, which may fit you requirements or not. If you are fine just being specific to Gmail it is likely easier and better to work with from a web/mobile type environment than something like IMAP.

提交回复
热议问题