我尝试部署firebase函数,但由于ESLint的某些问题,它一直在失败.我也试过谷歌搜索答案,但我看到的一切都是希腊语给我.
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
// exports.helloWorld = functions.https.onRequest((request, response) => {
// response.send("Hello from Firebase!");
// });
//import firebase functions modules
const functions = require("firebase-functions");
//import admin module
const admin = require("firebase-admin");
admin.initializeApp(functions.config().firebase);
// Listens for new messages added to messages/:pushId
exports.pushNotification = functions.database.ref("/Message").onWrite( event => {
// Grab the current value of what was written to the Realtime Database.
var valueObject = event.data.val(); …
Run Code Online (Sandbox Code Playgroud)