您好,我想自动发送短信,而不是使用Cordova短信插件。我想发送验证码给每个客户后,他们注册的应用程序。有没有可能做到这一点?希望你能帮助我。提前谢谢你。我正在使用Ionic 2。
发布于 2017-11-18 21:20:55
如果你有一个后端在运行,这是相当容易的。此示例将节点与Nexmo SMS API一起使用。
app.post('/', (req, res) => {
res.send(req.body);
const toNumber = req.body.number;
const text = req.body.text;
nexmo.message.sendSms(
NUMBER, toNumber, text, {type: 'unicode'},
(err, responseData) => {
if (err) {
console.log(err);
} else {
console.dir(responseData);
}
}
);
});有关完整示例,请参阅this article。
https://stackoverflow.com/questions/47366442
复制相似问题