I am just creating a onCreate trigger in firebase and it is not working for me.
const admin = require("firebase-admin");
const functions = require('firebase-functions');
var serviceAccount = require("./abc.json");
admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: "https://PROJECT_ID.firebaseio.com" });
exports.sendNotifications = functions.firestore .document('messages/{messageId}') .onCreate((snapshot, context) => { functions.logger.debug('This is a test'); })
and this function is successfully deployed and worked when i test it but not trigger automatically when new messageId is created.
I also try many other triggers like onWrite, onDelete etc but no one automatically invoke when data change.
please help and thanks in advance.
I want that it trigger automatically when new chat message come so that i can send chat notification to second person.