0

I use Firebase services, and I want when a user likes a photo, the owner receives a push notification accordingly. I just implemented all this with Firebase event listeners , but it works when the program is open, as soon as the program is closed, the Firebase event listeners stop working. How can I send a push notification when the user on the other end of the app is closed? As it is done in Telegram or Instagram.

Yaroslav Babiy
  • 1
  • 1
  • 1
  • 1
  • You tagged your question with `firebase-cloud-messaging` so already seem to know that's what it'll take. You can't push directly from one client to another securely though. You'll need a server of Cloud Functions to listen to the changes in the database, and then call the FCM API from there. Have a look at my answer here, for the correct solution and links: https://stackoverflow.com/questions/37990140/how-to-send-one-to-one-message-using-firebase-messaging, https://stackoverflow.com/a/63317003/209103 – Frank van Puffelen Sep 11 '21 at 16:19

0 Answers0