通过我的移动应用程序,我想向多个电话号码发送以下消息:
“John Doe邀请你参加会议。下载会议材料
http://alink.com
"
此消息将是
Transactional
我有一个节点。js在EC2上运行。我是一名移动应用程序开发人员,刚接触AWS。
在我的SNS控制台中,我创建了一个主题。这创建了ARN:
arn:aws:sns:us-east-1:xxx1234xxxx:MyAppName
我在NodeJS中有以下代码:
var AWS = require('aws-sdk');
var auth = require('../snsAuth');
AWS.config.update = auth
var sns = new AWS.SNS();
var params = {
Message: "John Doe invited you to a meeting. Download meeting material http://alink.com",
MessageStructure: 'string',
PhoneNumber: '1xxx1234',
Subject: 'MyApp'
};
sns.setSMSAttributes(
{
attributes: {
DefaultSMSType: "Transactional"
}
},
function (error) {
if (error) {
console.log(error);
}
}
);
sns.publish(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
我不知道如何发送多个电话号码作为参数。根据这些文档,我似乎需要先订阅一个主题,然后再发布该主题。如果这些是正确的步骤,那么如何在代码中做到这一点?