I am working through the in app purchase documents. All my funcitons deployed except the serverLog function. serverLog docs.
Not sure what I am missing. I know @jared is a pro at this so hopefully he can straighten me out.
index.js:
const functions = require("firebase-functions");
const admin = require("firebase-admin");
admin.initializeApp();
exports.purchaseInfo = functions.https.onRequest((request, response) => {
const dbRef = admin.database().ref("purchases")
const data = request.body;
const queryTerms = request.query;
const objToSave = {
data, queryTerms, timestamp: admin.firestore.FieldValue.serverTimestamp(),
};
//add this objToSave the realtime database
dbRef.push(objToSave);
response.send("success").status(200);
});
package.js:
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"version": "1.0.0",
"dependencies": {
"firebase-admin": "^9.8.0",
"firebase-functions": "^3.14.1"
}
}
I get this notification when it fails: