How to send a push notification

2019-07-21 03:57发布

问题:

What is a service that i can use to send a notification using the eclipse SDK? I want it so i can send it in real time! -Cam

回答1:

You have to use GCM - Google cloud messaging for sending push notifications to Device.

Refer to demo application given in android developer site.

GCM Demo Application

And main link is - Google Cloud Messaging for Android



回答2:

I think the best way to send notifications in Android is FCM(Firebase cloud message ), and this service is also from google which is a replacement for GCM.Use the below link for more information.

https://firebase.google.com



回答3:

In my opinion Firebase cloud messaging is the best option. Because FCM has several advantages over GCM.

Firebase Cloud Platform inherits GCM's core infrastructure but simplifies the client development.

In FCM you do not need to write your own registration or subscription retry logic. Now, you can integrate FCM in your app with just a few lines of code.

However, GCM is not deprecated: Google will continue to support it but all new client-side features will be available on FCM SDK only. The protocol remains the same server-side though.

Update (30 - July - 2018): As of April 10, 2018, Google has deprecated GCM. The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. See this migration guide to learn more.

Thanks @eis for your comment to update this post.



回答4:

I think Google Cloud Messaging for Android is the way to go.