This module provides notification bar message monitoring functionality for Android devices within the Total Control environment.
It allows scripts to capture, filter, and respond to system or app-level notification messages in real time.
Key Features:
- Create
Notificationobjects to monitor messages by device, app, and content pattern. - Support both batch polling (
getNotification()) and real-time listener (setListener()). - Support regex pattern matching and wildcard (
tcConst.Any) for flexible filtering. - Retrieve matched notifications including app name, content, and device source.
- Fully controllable with
reset()anddeleteListener()to manage message flow and memory.
Usage Scenarios:
- Capture incoming notifications from specific apps like WeChat, WhatsApp, etc.
- Automatically trigger actions on receiving certain messages.
- Monitor all messages across all devices for debugging or logging.
Basic Usage:
- Enable TC notification listener service in the Total Control mobile client:
- Open Total Control app on the phone
- Go to Settings → Message Settings → Enable TC Notification Listener Service
- Create a
Notificationobject:var { Notification } = require("sigma/notification"); var notify = new Notification(tcConst.Any, "com.tencent.mm", "payment received"); - Retrieve notifications:
var logs = notify.getNotification(); - Register a listener:
notify.setListener(function(dev, app, msg) { print(app + ": " + msg); });
This module attaches all methods to the Notification class and supports dynamic parameter binding and monitoring behavior.