How can I send a push notification to a specific user ID in firestore when an event is triggered (example : on button clicked)


Solution 1: Zhangir Siranov

Button click is not the best example of trigger for notification, because if it happens locally on device, you can return the notification right from there.

More common trigger would be the creation of document in Firestore, that you can monitor by using firebase Admin SDK and Google cloud functions. If you wish to send notifications from there, you will have to get the firebase_messaging plugin in your project, and by getting the device token send it to there. I'm attaching the link for the good video made by fireship.