简体   繁体   English

像WhatsApp这样的Android通知

[英]Android Notifications like WhatsApp

I'm making an Android application and I want to get notifications like in WhatsApp – as the message comes. 我正在制作一个Android应用程序,并且希望收到类似WhatsApp的通知。 If any updates are made on the server then a notification should come to the user so he can check the application. 如果服务器上进行了任何更新,则应通知用户,以便他可以检查应用程序。 Any help would be appreciated. 任何帮助,将不胜感激。

Firstly you need to integrate GCM with your system, so application need to get sender_id from google and put it to your server. 首先,您需要将GCM与系统集成,因此应用程序需要从Google获取sender_id并将其放置到服务器中。 Then if you want to invoke notification on your app you need to send message using this sender_id. 然后,如果要在应用程序上调用通知,则需要使用此sender_id发送消息。

Here you can find nice tutorial. 在这里您可以找到不错的教程。 If you will have any question just give me a word. 如果您有任何问题,请给我一个字。

I hope it would help you 希望对您有帮助

You need to use Google Cloud Messaging . 您需要使用Google Cloud Messaging With it you can send information from a server to an Android device. 有了它,您可以将信息从服务器发送到Android设备。 The Android device will be waiting for messages from the server instead of polling the server at timed intervals. Android设备将等待服务器发出的消息,而不是按时间间隔轮询服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM