Giovanni Laganà
Giovanni Laganà

Reputation: 11

How can I make the server actively notify the client of resource change?

My client is an android application and the server is a REST server in spring boot, they are both written in Kotlin. The scenario is that we have multiple clients communicating with the server and writing a resource in the DB. Among these clients, there is a coordinator, which I would like to be informed of each time this resource is updated.

Is PUSH notification a possible solution? If yes, who triggers the notification? Let's assume that I don't want the Firebase console to launch these notifications. I have seen these tutorials: this for client and this for server. A notification firebase controller is built with its endpoints, does this mean that a request is needed to get these notifications? I am not getting how does it work and if this type of communication is made without polling from the client.

Upvotes: 1

Views: 452

Answers (1)

Abhijith mogaveera
Abhijith mogaveera

Reputation: 1294

  1. Socket -> https://github.com/Tinder/Scarlet u can use scarlet to communicate with sever which is similar retrofit

  2. FCM -> https://stackoverflow.com/a/37948441/8370216 u can trigger this from your server instead of push notification use data payload because it gives u more control

Upvotes: 1

Related Questions