问题描述
我当前正在使用react js Web应用程序,并且正在使用Twilio可编程SMS服务,该服务在Chrome和Firefox上正常运行,但是当我尝试从Safari浏览器发送SMS时,它显示“网络错误”。 / p>
以下是我的短信示例代码:
const twilio = require('twilio');
var client = new twilio(config.TWILIO.accountSid,config.TWILIO.authToken);
var twilioObj = {
body: messageBody,from: config.TWILIO.fromNumber,to: '+91' + toNumber
};
if (medialLink !== undefined) {
twilioObj = {
body: messageBody,mediaUrl: [medialLink],to: '+91' + toNumber
};
}
return new Promise(function (resolve,reject) {
client.messages.create(twilioObj)
.then(function (message) {
alert('message sent')
resolve({
status: true,message_id: message.sid
});
})
.catch(function (error) {
alert('error' + error)
resolve({
status: false,});
});
});
有人遇到同样的问题吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)