requestSendNotification
Bắt đầu hỗ trợ ở phiên bản:
- SDK: 2.27.1
Yêu cầu người dùng cho phép ứng dụng gửi thông báo qua OA Mini App

Parameters
Object object
| Property | Type | Default | Required | Description | Minimum Version |
|---|---|---|---|---|---|
| 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 { requestSendNotification } from "zmp-sdk/apis";
requestSendNotification({
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 { requestSendNotification } from "zmp-sdk/apis";
const sendNotification = async () => {
try {
await requestSendNotification({});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};
Errors
| Code | Message | Note |
|---|---|---|
| -201 | User deny request permission! | Người dùng từ chối cấp quyền |
| -202 | User deny request permission! | Người dùng từ chối cấp quyền và không muốn hỏi lại |
| -2002 | User denied | Người dùng đã từ chối cấp quyền trước đó và không muốn hỏi lại |