我已经能够使用从节点库构建的meteor-twilio包(你需要一个Twilio帐户)来做到这一点.该软件包导出一个名为Twilio的全局,您可以像这样使用:
// server-side code
...
var twilio = Twilio(accountSid, authToken);
this.unblock(); // make the request asynchronously
twilio.sendSms({
to:'+445678984', // any number Twilio can deliver to
from: '+12125551212', // must be your Twilio account phone number
body: 'here is your confirmation'
}, function(err, responseData) { //executed when a response is received from Twilio
if (!err) {
// "responseData" is a JavaScript object containing data received from Twilio.
console.log(responseData.body); // outputs "here is your confirmaton"
}
...
Run Code Online (Sandbox Code Playgroud)
这可以在Meteor.method通话中完成.
| 归档时间: |
|
| 查看次数: |
1459 次 |
| 最近记录: |