I am developing an app that users record and post incidents, and nearby users see these posts, so I finished the app but I don't have any idea about notifications, so how can I notify users when incidents are posted? (I need any article or anything related to this thing). I am using firebase real-time database
Asked
Active
Viewed 1,055 times
1

Frank van Puffelen
- 565,676
- 79
- 828
- 807
-
1If you consider at some point in time to try using [Cloud Firestore](https://firebase.google.com/docs/firestore/), here you can find an [answer](https://stackoverflow.com/questions/48298993/push-notifications-on-content-change/48299840) that might help. – Alex Mamo Nov 17 '21 at 08:12
-
This sounds like a typical use-case for Cloud Functions. For an example, see the use-case: [Notify users when something interesting happens](https://firebase.google.com/docs/functions/use-cases#notify_users_when_something_interesting_happens) – Frank van Puffelen Nov 17 '21 at 15:56
1 Answers
1
This sounds like a typical use-case for Cloud Functions. For an example, see the use-case: Notify users when something interesting happens, which shows:
Developers can use Cloud Functions to keep users engaged and up to date with relevant information about an app. Consider, for example, an app that allows users to follow one another's activities in the app. Each time a user adds themselves as a follower of another user, a write occurs in the Realtime Database. Then this write event could trigger a function to create Firebase Cloud Messaging (FCM) notifications to let the appropriate users know that they have gained new followers.
- The function triggers on writes to the Realtime Database path where followers are stored.
- The function composes a message to send via FCM.
- FCM sends the notification message to the user's device.
To review working code, see Send FCM notifications.

Frank van Puffelen
- 565,676
- 79
- 828
- 807