I have implemented a chat app using cloud firestore.
I want to send notification on the receiver mobile when a new message is sent. If anyone can understand the problem. Help will be appreciated <3. Thanks.
I found this article that you might find useful, it is very detailed an even includes the code, basically the trick is to use Cloud Firebase Functions to listen any changes on the collection, in your specific use case, try to listen the onCreate
trigger, that will be fired each time a user creates a new message (document) on the collection, more information on the Database Triggers can be found here
Then you only have to trigger the sendToDevice
method from within the onCreate
listener to push the message into the device.