when I use this function which triggered when something changes in /drivers/{wilayaid}/{driverid}/proposed .. it gives me TypeError: change.after.get is not a function
exports.sendNotification = functions.database.ref('/drivers/{wilayaid}/{driverid}/proposed').onUpdate(async (change) => {
const fcm = change.after.get('fcm');
var message = {
notification: {
title: "CLIQUE ICI",
body: "NOUVELLE OFFRE DE TRANSPORTATION",
},
token: fcm,
}
let response = await admin.messaging().send(message);
console.log(response);
console.log(fcmToken);
});
I dont know why !!!