I'm making an app that receives push notifications from the server. I found some ways to do that.
SMS - Block incoming sms and pull them to the server.
Poll - Periodically checks the server.
There are two ways, but each one has its own limitations. SMS does not guarantee arrival time Poll eats away at the battery.
Is there a better way?
android alerts push
Google's answer to this question is
Android Cloud to Device Messaging Framework (deprecated)
Google Cloud Messaging(deprecated)
3.Firebase Cloud Messaging (https://firebase.google.com/docs/cloud-messaging/)
There is. But number 1 and 2 are currently defined, so you can use number 3 Firebase Cloud Messaging. It'll work fine on Android 2.2 and above.
© 2024 OneMinuteCode. All rights reserved.