This source code demonstrates how to send firebase cloud messaging notification using firebase functions on document changes in the firebase firestore.
Give this repository a star if you find it useful :)
Step1: Clone this repository using the following command.
git clone https://github.com/abhidiwakar/firebasecloudmessaging_using_firebasefunctions.git
Step2: Start using the functions or modify them as per your need.
- sendNotificationToTopic
- sendNotificationToFCMToken
1st function is used to send firebase cloud messaging notification to users subscribed to a topic.
2nd function is used to send firebase cloud messaging notification to a single user using FCM Token.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.