I am trying to send a notification to all users of my app whenever there is a write on the database.
Here is the code that I have so far.
export const newUserAdded = functions.database
.ref('1_0_0/updateDate/date')
.onWrite((event)=>{
//send notfigication to all
admin.messaging().sendToCondition()
})
As you can see whenever there is a write to the date
key the function will trigger.
But note here that I do not have device token of the user as I want to send a notification to all users. I was not able to find any method do so.
Kindly do let me know how can I achieve this.
Thanks