send notification when new child is added to Fireb

2019-07-31 19:36发布

问题:

I am using Firebase database in my app, and I need to send a notification to the Admin when a new order is added to the database "new child added to the database".
I found something called Firebase cloud messaging but I don't know how to use it.

Any help, please?

回答1:

The Firebase Cloud Messaging is used to send push notification to a devices or a group of devices.The thing that you want to achive can be implemented by using Cloud Functions for more details

HERE

Codelab

You need to specify a node which will be trigger when a child is added to a database in cloud function and than in that cloud function you can write your logic to send push notification to the admin

This Example will help to you start with