无法使用 Amazon SNS 向美国号码发送消息

问题描述 投票:0回答:1

这是我使用 Amazon SNS 发送消息的代码。

当我尝试使用印度号码时它工作正常,但当我尝试使用美国号码时它失败了。我想修复它。

async sendMessage(testId: number) {

    require('dotenv').config();
    
    
    var mobileNo = +17866987580//dummy number
    
    var params = {
      Message: `A backflow test was completed successfully.`,
      PhoneNumber: mobileNo,
    };
    return new AWS.SNS({ apiVersion: '2010–03–31' })
      .publish(params)
      .promise()
      .then((message) => {
        console.log('Message SEND SUCCESS');
      })
      .catch((err) => {
        console.log(err);
        return err;
      });

}
node.js typescript amazon-web-services amazon-sns
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.