Nhảy tới nội dung

Bắt đầu hỗ trợ ở phiên bản:

  • SDK: 2.5.3
Lưu ý

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​

PropertyTypeDefaultRequiredDescriptionMinimum Version
contentstringtrueNội dung tin nhắn
phoneNumberstringtrueSố điện thoại
successfunctionCallback function khi gọi api thành công
failfunctionCallback function khi gọi api thất bại

Sample Code​

import { openSMS } from "zmp-sdk/apis";

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

import { openSMS } from "zmp-sdk/apis";

const openSMSScreen = async () => {
try {
await openSMS({
content: "text",
phoneNumber: "+84123456789"
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};