openPhone
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
Cho phép ứng dụng mở màn hình cuộc gọi với một số cụ thể
Parameters
Object object
Property | Type | Default | Required | Description | Minimum Version |
---|---|---|---|---|---|
phoneNumber | string | 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 { openPhone } from "zmp-sdk/apis";
openPhone({
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 { openPhone } from "zmp-sdk/apis";
const openCallScreen = async () => {
try {
await openPhone({
phoneNumber: "+84123456789"
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};