I am trying to deploy a Firebase Function (a notification for the app) that fetches a value from a third party website. But, when I call the json, it says that that value does not exist in the error logs. Is there an obvious solution to this?
Follow up Edit: How do I get the data in the fetch method to be shown in the title?
const url = new URL(
"test.com"
);
let params = {
"value": "title",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
fetch(url, {
method: 'GET',
})
//This is where you usually would log the data .then(json => console.log(json));
const payload = {
notification: {
title: json,
body: 'The current events for today have been updated.',
badge: '0',
sound: 'default',
}
};