So I have the following notification function,
async function sendNotification(registrationToken, title, body) {
const message = {
to: registrationToken,
notification: {
title: title,
body: body
}
};
await fcm.send(message, (err, response) => {
if (err) {
return err;
}
else {
return response;
}
});
};
When I call the function like this in the api
let result = await sendNotification('','','');
result is always undefined. How do I solve this issue?