我有一个firebase函数,它模仿https://github.com/firebase/functions-samples/tree/master/email-confirmation
我有以下数据库规则:
{
"rules": {
".read": true,
".write": true,
"iv": {
"contactus": {
".read": true,
".write": true
}
}
}
}我的Firebase函数使用以下数据库ref
exports.sendEmailConfirmation = functions.database.ref('/iv/contactus').onCreate(event => {
const snapshot = event.data;
const val = snapshot.val();
console.log('value is:' + JSON.stringify(val));此firebase函数不会被触发。
我的数据库结构如下
iv
contactus
-KrsVfIJ4R6z6HAvguC9
contactDate:
email:
message:
name:
phonenumber: 我尝试将{uid},{userid}等添加到数据库ref和规则中,但仍然没有触发。
我做错了什么?
谢谢,Rajesh
发布于 2017-08-23 04:33:07
更改自:
exports.sendEmailConfirmation = functions.database.ref('/iv/contactus').onCreate(event => {
收件人: functions.database.ref('/contactus/{pushId}').onWrite(event => {收件人: exports.sendEmailConfirmation
https://stackoverflow.com/questions/45767426
复制相似问题