0
我的lambda函數有問題。它獲取設備的數據併發送推送通知(某人將你添加到朋友的信息)。但是,經常發生推送通知未被髮送。有時,我必須激活幾次功能(通過同時點擊按鈕),才能發送推送通知。在Lambda中測試下面的函數時,它不會發送任何推送通知。什麼可能是這個問題?通過lambda發送SNS推送 - 沒有消息?
謝謝你在前進, 約翰
console.log("Loading friend-request function");
var AWS = require("aws-sdk");
exports.handler = function(event, context) {
var senderID = event.senderID;
var receiverID = event.receiverID;
var message = event.message;
var eventText = JSON.stringify(event);
console.log("Received event:", eventText);
var sns = new AWS.SNS();
var params = {
Message: message,
Subject: "Test SNS From Lambda",
TargetArn: receiverID
};
context.succeed(message);
sns.publish(params, context.done);
};
This Works,thank you! :) –