I’m trying no notify firebase topic about any change in one of my collection.
What is wrong?
This is the function :
exports = function() {
context.http.post({
url: "https://fcm.googleapis.com/fcm/send",
headers: {
"Authorization key" : "AAAAI......",
"Content-Type" : "application/json",
},
body: {
"to" : "/topics/messaging",
"notification" : {
"body" : "Body of Your Notification",
"title": "Title of Your Notification"
},
},
encodeBodyAsJSON: true
});
};
This is the error
ran on Thu Jun 17 2021 19:35:07 GMT+0300 (Israel Daylight Time)
took 262.907943ms
error:
uncaught promise rejection: http request: “headers” argument must be a object containing only string keys and string array values