Skip to content

Event Notifications

iClick actively pushes various event notifications through WebSocket, allowing your application to respond to device status changes, USB connection status, and other events in real-time.

Event Format

Event format pushed by the server:

json
{
  "type": "event",
  "event": "event_name",
  "data": { /* event data */ }
}

Field Description:

  • type (string): Fixed as "event", indicating this is an event push
  • event (string): Event name, used to distinguish different types of events
  • data (object): Data carried by the event, varies by event type

Event List

Device Events

Event NameDescriptionTrigger Timing
device:onlineDevice onlineTriggered when iOS device connects to iClick
device:offlineDevice offlineTriggered when iOS device disconnects
device:rejectDevice connection rejectedTriggered when device cannot connect due to permission issues
device:deleteDevice deletedTriggered when device is removed from the device list
device:busyDevice busyTriggered when device starts executing a task
device:idleDevice idleTriggered when device completes a task and becomes idle
device:renameDevice renamedTriggered when device name is modified
device:bindchipDevice bind chipTriggered when device is bound to a USB chip board

USB Events

Event NameDescriptionTrigger Timing
usb:plugUSB plugged inTriggered when USB chip board connects
usb:unplugUSB unpluggedTriggered when USB chip board disconnects

Event Examples

device:online

Device online event, triggered when iOS device successfully connects to iClick.

Event Data:

json
{
  "type": "event",
  "event": "device:online",
  "data": {
    "info": {
      "deviceName": "My iPhone",
      "deviceIdentifier": "iPhone15,2",
      "deviceChip": "XXXXXXXX",
      "screenWidth": 1179,
      "screenHeight": 2556,
      "orientation": 1,
      "screenScale": 3.0,
      "deviceVersion": "17.0",
      "deviceRounded": true
    },
    "plugged": true,
    "time": 1697472000,
    "online": true
  }
}

Cooperation: try.catch@foxmail.com