So I am developing an app with many users, I want to be able to send cloud messages on a user using their UID as a destination. Its kind of like sending an SMS message to a specific phone number.
The cloud message should be send on button click, and sent to the user with the particular UID.
My application is an Mobile SOS.
I have 2 application an admin application(Responders) and client app(Users who request for SOS)
what I want to do is, when a user sends an SOS, all the admin accounts will recieve a notification even if the application is on background or closed. then when the admins(rescuers) responds to this on button click, the specific user that sent this will recieve a notification that help is on the way, and only that user will see the notification.
is this all possible?
My data structure for the emergency list(SOS Requests from the users)
Firebase-root
|
--- Emergencies (collection)
|
--- -NGdm9B7kdtbQlZ-_YHh (I used push keys)(document)
| |
| --- //emergency properties
| --- UID (The UID is within this document (It is the user that sent the SOS)
|
--- NGdm9B7kdtbQlZ-_YHh (I used push keys)(document)
|
--- //emergency properties
--- UID (The UID is within this document (It is the user that sent the SOS)
For the users list, theres another collection for that like this:
Firebase-root
|
--- users (collection)
|
--- 4bNpqxVy7.... (UID)(document)
| |
| --- //user properties
|
|
--- J2xMEbKO....(UID)(document)
|
--- //user properties