sms
用于发送短信的模块
API
invoke
执行发送短信操作
invoke([tos], text, callback)
- @tos [String Array]:接收人,字符串数组
- @text {string}:短信内容,可选
- @callback {Function}:执行完该操作后的回调函数。回调函数将收到一个Response对象
result {string}
:success仅表示执行操作成功,不表示短信发送状态,error表示发生了错误message {string}
:错误描述,只当result为error时有此字段
Demo
var sms = weex.requireModule('sms');
const modal = weex.requireModule('modal');
sms.invoke(['10010'],
'message goes here.', (e) => {
if(e.result == 'success') {
modal.toast({
message: "sms invoke success",
gravity: "bottom"
});
}
});