openSMS
Bắt đầu hỗ trợ ở phiên bản:
- API: 2.5.3
Lưu ý
Với API version ﹤ 2.23.0, phải gọi api login trước khi gọi api này và cần xin cấp quyền tại trang Quản lý ứng dụng
Mở ứng dụng tin nhắn
Parameters
Object object
Property | Type | Default | Required | Description | Minimum Version |
---|---|---|---|---|---|
content | string | true | Nội dung tin nhắn | ||
phoneNumber | string | true | Số điện thoại | ||
success | function | Callback function khi gọi api thành công | |||
fail | function | Callback function khi gọi api thất bại |
Sample Code
import api from 'zmp-sdk';
api.openSMS({
content: 'text',
phoneNumber: '+84123456789',
success: () => {
// xử lý khi gọi api thành công
},
fail: (error) => {
// xử lý khi gọi api thất bại
console.log(error);
}
});
// hoặc
const test = async () => {
try {
await api.openSMS({
content: 'text',
phoneNumber: '+84123456789'
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};