0
votes

I'm using Firebase cloud Functions to Trigger Notifications and Can we use onWrite() on two database references. If possible how to accomplish?

1
One function can only respond to changes at one location at a time. - Doug Stevenson
I'm just using a single database for both Admin and Client app and I need to trigger notifications to both apps when two specific nodes are updated with data. Is this possible? @DougStevenson - user7857570
Sure, write two different functions for the two nodes that do similar work to send the messages. - Doug Stevenson
Sure, I'll work on it! @DougStevenson - user7857570

1 Answers

0
votes

Cloud Functions for Firebase lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests but a single cloud function can only respond to changes that happens also at a single location at a time.

If you have more that one node that you want to be triggered, you need to write separate (different) functions for each node that can work similarly.