###Gmail API Google終於提供了Gmail Push Notification功能了。 Synchronizing Clients with Gmailios
Keeping your client synchronized with Gmail is important for most application scenarios. There are two overall synchronization scenarios: full synchronization and partial synchronization. Full synchronization is required the first time your client connects to Gmail and in some other rare scenarios. If your client has recently synchronized, partial synchronization is a lighter-weight alternative to a full sync. You can also use push notifications to trigger partial synchronization in real-time and only when necessary, thereby avoiding needless polling.api
正如Google所說,以前咱們爲了同步用戶的郵件信息或者新郵件通知的時候,服務器端須要不停的去Google調用用戶當前的郵件信息。如今經過它新提供的push notification功能,服務器不須要主動去獲取,而是隻須要在那等待Google主動發送請求到咱們服務器上便可。服務器
###注意事項 在同步郵件的時候須要注意下面幾個方面:app
message.list
,batch request
和message.get
來同步用戶的所有郵件信息。Users.watch
開啓監聽並獲取最新的historyId並保存到本地Users.history.list(Client.historyId)
來獲取差別部分。