使用 AWS SNS 的短信未发送到印度号码

SMS not delivered to India number using AWS SNS

您也可以在 AWS 线程上找到这个:AWS Developer Forums: No SMS delivered on India phone number ...

var sns = new AWS.SNS({ "region": "ap-south-1" }); 

var params = {
        Message: 'this is a test message',
        PhoneNumber: '+91xxx'
      };
sns.setSMSAttributes({
        attributes: {
            DefaultSMSType: 'Transactional'
        }
});
sns.publish(params, function(err, data) {
        if (err) console.log(err, err.stack); // an error occurred
        else     console.log("success "+JSON.stringify(data)); // successful response
 });

我收到了消息 ID 作为回应,但短信从未送达。

{
  ResponseMetadata: { RequestId: '1d6dd652-fd57-5f7d-ad7f-XXXXX' },
  MessageId: '431efd91-7356-5e8e-9384-XXXX' 
}

在研究过程中,我发现我之前没有在控制台中 select 将 "Default Messaging Type " 设置为 Transactional(见图)。一旦我 select 将其编辑为交易,我就开始接收短信。