引用:
作者A級黑豬肉
Apple 的 Notification Centre 是會讓 iPhone 保留一個連線,由 Apple 伺服器推播東西過來。Google 是由程式本身自己做,沒有經過 Google 伺服器
|
早在 2010 年,
Google 為了避免各別的開發者, 長時間使用 polling 浪費電源,
開放了 Cloud to Device Messaging (C2DM),
方法就是: Android OS 在有網路連線的時候, 與 Google 的 Server 保持一個連線, 讓訊息可以即時推進來,
開發者在第三地想要推送訊息, 都是送到 Google 的 Server , 再利用這個連線來送,
程式收到訊息後, 再自己開連線去拉更多的內容.
2012年, 改名為 Google Cloud Messaging(GCM) for Android .
連 windows phone 7.5 的通知, 也是這種模式.