Listening for Events
You can listen for events by running the following code:
UpscopeManager.shared?.on(MessageType.EVENT_NAME) { data ->
// Handle event
}
List of Events
| Event Name | Additional Arguments | Description |
|---|---|---|
BEGIN_SESSION | — | A session has started. |
CONTINUE_SESSION | — | A session is continuing from a previous app launch. |
END_SESSION | — | A session has ended. |
STOP_SESSION | — | The session was stopped by the visitor. |
NEW_OBSERVER | observerId: String, observerData: { id: String, name: String?, screenWidth: Int, screenHeight: Int, windowWidth: Int, windowHeight: Int, hasFocus: Boolean } | Indicates a new agent is observing. |
OBSERVER_UPDATE | observerId: String, data: Map | An observer's data has changed. |
CUSTOM_MESSAGE | message: String | A custom message sent by an observer or visitor. |
