# Events

We'll broadcast several events on the fly. You can subscribe to the relevant events to handle your own logic.


All callbacks for subscribed events will be executed in a background thread. Please be cautious when manipulating UI elements.


# registerAsyncEventListner()

To register a callback for a specific event.

        [](const char *jsonData, Acknowledge ack) {
            // You can get callback here if the target event is fired
            // checkout at the defination and code examples for more information

# unregisterAsyncEventListner()

To unregister a callback for a specific event.


# Definition

# eventType

  • Type: EventType
  • Details: Required All Events may be triggered. It's worthing noting that different events may carry different parameters, some may need a acknowledge callback.

# asyncEventListener

  • Type: (const char *jsonEventData, void (*acknowledge)(EventType eventType, const char *jsonAckData))
  • Details: Required The callback for registering an event.
  • Explanation:
    • jsonEventData: Event data in JSON format
    • acknowledge: Use this callback method to send acknowledgment for several events
      • eventType: Current event
      • jsonAckData: Acknowledge data in JSON format

# Enumeration

# Initialization

# Logging In

# Authentication

# Unread Message

# Uploading Logs

# Clicking URLs

  • Enum: EventType.URL_CLICK
  • Data: { "url": "https://your.target.url?js-bridge=enable" }
  • ACK: -
  • Details: When links containing js-bridge=enable as parameters are clicked, this event is triggered.

# Opening AIHelp

  • Enum: EventType.SESSION_OPEN
  • Data: -
  • ACK: -

# Closing AIHelp

  • Enum: EventType.SESSION_CLOSE
  • Data: -
  • ACK: -
Last Updated: 7/7/2024, 10:24:50 AM