Android push notification without firebase

I want to send Android a push notification to the selected user without using gcm or firebase. The application is already built without FireBase. Now I need to add a push notification.

Question:

  • How is this possible without firebase?

Actually, I want a function that, when the administrator updates the value in one field in the database table of a specific user, this user will receive a push notification about the update. How is this possible?

+21
source share
3 answers

The method is to create a user service https://developer.android.com/reference/android/app/Service.html that keeps a connection through a socket or polls some remote server at intervals.

But I believe that the Firebase service is more advanced and optimized for battery consumption and, in particular, when using sleep mode. It is not trivial to make a service that will have a fast response and CPU consumption. I think that the development of user services will lead to native (C ++) coding of network routine libraries.

Also, be aware that Firebase provides its own authentication service with the ability to seamlessly convert your anonymous user into a registered user. There are many advantages to Firebase services. And cons: your users must install Google Play Services, if your application grows, you will pay Firebase.

See here Android push notifications without Google service

+9
source

Firebase is extremely user friendly and does a lot for you . Of course, it is possible to send a notification to selected users, but it requires a certain amount of knowledge. As for how; To a large extent, you need to configure a server that receives requests and sends data to certain devices using tokens. You must also take care of security. Good luck

+3
source

This is possible using VAPID authentication.

Google for VAPID, and you will find a very winding path that can lead to the answer you are looking for.

0
source

Source: https://habr.com/ru/post/1013838/


All Articles