# Events

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

Note

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

# API

# registerAsyncEventListener()

To register a callback for a specific event.

AIHelpSupport.RegisterAsyncEventListener(
        YOUR_EVENT, 
        (jsonEventData, ack) => {
            // You can get callback here if the target event is fired
            // checkout at the definition and code examples for more information
        }
);

# unregisterAsyncEventListener()

To unregister a callback for a specific event.

AIHelpSupport.UnregisterAsyncEventListner(YOUR_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: AsyncEventListener
  • Details: Required The callback for registering an event.
  • Explanation:
    • jsonEventData: Event data in JSON format
    • acknowledge: Use this callback to acknowledge JSON-format data for several events

# Enumeration

# Initialization

# Logging In

# Authentication

# Unread Message

# Unread Task

# Uploading Logs

# Clicking URLs

  • Enum: EventType.UrlClick
  • 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.

# Conversation Start

  • 枚举值:EventType.ConversationStart
  • 数据:{ "message": "this is the first message user sent" }
  • ACK:-

# Opening AIHelp

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

# Closing AIHelp

  • Enum: EventType.SessionClose
  • Data: -
  • ACK: -
Last Updated: 8/16/2024, 10:59:25 AM