Я хочу отправлять push-уведомления в моей функции лямбды.Это работает, как и ожидалось, на localhost, но когда я нажимаю его на лямбда-код не работает.Вот мой код:
const FCM = require('fcm-node');
let sendNotification = function(regToken) {
let serverKey = 'MY_SERVER_KEY';
let fcm = new FCM(serverKey);
let message = {
to: regToken,
notification: {
title: 'Title of push notification',
body: 'Body of push notification'
}
};
fcm.send(message, function(err, response){
if (err) {
console.log("Something has gone wrong!", err);
} else {
console.log("Successfully sent with response: ", response);
}
});
}