【问题标题】:How do Gmail notifications work? (Android)Gmail 通知如何运作? (安卓)
【发布时间】:2019-05-04 06:35:18
【问题描述】:

当邮件到达时,gmail 如何检测到这一点?
我想,发送和接收电子邮件不是 Android 操作系统的一部分。
那么,gmail 是如何做到这一点的呢?
提前致谢。

【问题讨论】:

标签: android gmail-api email-notifications


【解决方案1】:

这是一个非常广泛的问题,但作为起点,我建议您查看 Google gmail API。有一些示例代码 sn-ps 来演示功能。

https://developers.google.com/apis-explorer/#p/gmail/v1/

具体来说,您可能希望专注于通过

设置挂钩

gmail.users.watch Set up or update a push notification watch on the given user mailbox.

如果您正在寻找更高级的信息,例如 Google 服务器如何发送 IPC;那么 Google 测试脚本可能会派上用场。

https://github.com/google/mail-importer/blob/master/src/test/java/to/lean/tools/gmail/importer/gmail/GmailSyncerTest.java

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-25
    • 2011-07-20
    • 2017-12-01
    • 2011-12-15
    • 1970-01-01
    相关资源
    最近更新 更多