Setting Notification Status for a Single App (V3)
Function: setSetNotificationStatus 【setNoticeMessageStateUseVersion0x20】
Flutter Example:
/// V3 Setting Notification Status event number
setNoticeMessageState(
evtBase: _VBusEvtBase.base_app_set,
evtType: _VBusEvtType.tran_json_set_notice_message_state),
/// V3 Setting Notification Status
libManager.send(evt: CmdEvtType.setNoticeMessageState, json: jsonEncode(json));
JSON field sent by the app:
Field Name | Field Type | Field Description |
---|---|---|
version | int | Library version number |
items_num | int | Number of message details |
operat | int | Operation 1: Add 2: Modify 3: Get and Query |
all_on_off | int | Add and modify only Overall notification switch 1: Enable all notifications 0: Disable all notifications |
all_send_num | int | Total number of packets sent For sending more than 100 packets in multiple parts all_send_num = now_send_index for completion of sending |
now_send_index | int | Current sequence of sending |
all_notify_state | int | Added and modified Valid Notification status General switch 0: invalid 1: all enable notifications 2: all silent notifications 3: all disable notifications function table setNoticeMessageStateUseVersion0x20 open effectively |
items | Array | Message details Collection of evt_type, notify_state, and pic_flag |
Field Name | Field Type | Field Description |
---|---|---|
evt_type | int | Event type |
notify_state | int | Notification status 1: Allow notifications 2: Silent notifications 3: Close notifications |
pic_flag | int | Applies when replying, set this parameter to 0 0: Invalid 1: Download corresponding image 2: No corresponding image |
APP Example of querying application notification status:
{
"version": 0,
"items_num": 0,
"operat": 3,
"all_on_off": 1,
"all_send_num": 1,
"now_send_index": 1
}
JSON field received by the app:
Field Name | Field Type | Field Description |
---|---|---|
version | int | Library version number |
err_code | int | Error code: 0 for success, non-zero for failure |
operat | int | Operation 1: Add 2: Modify 3: Get and Query |
all_on_off | int | Valid for querying Reply with overall notification switch status 1: Enable all notifications, 0: Disable all notifications -1:Invalid |
all_notify_state | int | Valid Total switch of notification status -1: invalid 1: all enable notifications 2: all silent notifications 3: all disable notifications function table setNoticeMessageStateUseVersion0x20 open effectively |
items_num | int | Valid for querying Number of message details in the firmware |
items | Array | Message details content, valid for querying |
Field Name | Field Type | Field Description |
---|---|---|
evt_type | int | Event type |
notify_state | int | Notification status 1: Allow notifications 2: Silent notifications 3: Close notifications |
pic_flag | int | 0: Invalid 1: Download corresponding image 2: No corresponding image |
Example of a device replying to query application status:
{
"version": 0,
"err_code": 0,
"operat": 3,
"all_on_off": 1,
"items_num": 2,
"items": [
{
"evt_type": 1,
"notify_state": 1,
"pic_flag": 1
},
{
"evt_type": 1,
"notify_state": 1,
"pic_flag": 1
}
]
}