N
N
Nikolay Alekseev2020-01-08 10:24:54
Android
Nikolay Alekseev, 2020-01-08 10:24:54

How to properly provide notifications in Android applications?

Good day to all!
I would like to understand how notifications work in modern applications.
Google documentation advises me to use Firebase. As far as I could understand, this is a kind of cloud service that takes on the responsibility of contacting each specific client to display notifications from him.
These notifications are initiated, as I understand it, by some demons on the backend.
Well, it sounds logical, but here the question arises: how is it arranged from an architectural point of view on the application side?
My application itself is a thin client that receives data from the server using rest api.
That is, there is no permanent connection with the backend. If he was, the question would disappear by itself.
Accordingly, the first thought is to make a background service that once a minute asks the server if there is anything new, and if there is, then notifies the user about it.
This, it seems, is not the best in terms of saving energy and user traffic (although the amount of data there is scanty)
And here I thought about firebase. It is unlikely that this technology has a permanent connection to the cloud ... or does it?
How is its use more convenient and logical in comparison with a self-made bicycle?
I would love to read the opinions of experienced developers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2020-01-08
@VariusRain

When the server needs to send a push, it does this - it shoots a message into the firebase apish. The delivery of the push to the application is handled by the firebase. It is enough to implement Broadcast Receiver. More details in the documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question