【发布时间】:2018-11-07 22:30:36
【问题描述】:
我在我的应用程序中执行 firebase 通知。 这是我的 node.js 函数
'use strict'
const functions = require('firebase-functions');
const admin=require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.sendNotificaiton=functions.database.ref('/Notifications/{userKey}/{notification_id}').
onWrite(event => {
const userKey = event.params.userKey;
const notification = event.params.notification;
console.log('The userKey is ', userKey);
});
我的 firebase 数据库结构是
函数错误是
请帮帮我。 提前致谢
【问题讨论】:
标签: node.js firebase firebase-cloud-messaging google-cloud-functions firebase-notifications