This is supposed to be an easy task. I'm so amazed by how much time I spent investigating the issue...
I have this Cloud Function in my index.js
:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.myFunction = functions.database.ref('/messaging/{pushId}')
.onWrite(event => {
//do something
});
According to this answer, I can simply add a second Function like so:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.myFunction= functions.database.ref('/messaging/{pushId}').onWrite(event => { //do something });
exports.secondFunction= functions.database.ref('/messaging/{pushId}').onWrite(event => {//do something });
But, in my Firebase Dashboard, there's still one Function listed: myFunction
. Did I miss something? How can I add 2 Cloud Functions properly?