Cloud Functions for Firebase database onWrite triggered twice
Hi I am developing a notification system, but I am having trouble deleting the processed notification data. The onWrite event listener is triggered twice resulting to two notifications. Can you help me find a work around so that onWrite event listener should not be triggered twice? It is important to delete the processed data. exports.sendMessageNotification = functions.database.ref('/notification/message/{recipientUid}/{senderUid}').onWrite(event => { /* processing notification and sends FCM */ return admin.messaging().sendToDevice(tokens, payload).then(response => { // For each message check