I have an android application like soc. network. And there are features like, comment, subscription. Now it is necessary to implement sending a notification to the application when updating the above functions. At first glance it seems simple. I thought that after all the new likes, comments I will send a notification to the user all. But it turned out very difficult)

The fact is that among the users there will be popular users who have a lot of likes for each post, comments almost every second. And if each action is sent as a notification, then simply it will annoy the user, and the phone will continue to sound about the new notification. How can this be done beautifully?

How do social networks work in VK networks, etc.?

And one more not unimportant question, how to check whether a new notification has come, saving as much as possible on the battery and mb data if you make independent requests to the server?

For example, as Telegram does, the message arrives instantly, but at the same time both the battery and the mb data are used economically.

    1 answer 1

    The algorithm for sending push notifications you need to implement on the server side, with which your Android application interacts. In the mobile application, you need to register the device on the push notification service, get the token and then send it to the server with information about the current device and user.

    On the server side, already develop an algorithm for building push notifications. Where to prioritize and sort the number of notifications depending on the current user of the application.

    I advise you to use one of the services to implement push notifications:

    • Fine! Also, how to check whether a new notification has arrived, saving as much as possible on the battery and mb data if you make independent requests to the server? - Fəqan Çələbizadə