CommunicationManager

data class CommunicationManager(listener: Communication, onResponse: (String) -> Unit)

The middleware between the PACE Cloud SDK and the PWA that routes the message to the correct handler and serialized/deserialized the request and response JSON correctly.

Constructors

CommunicationManager
Link copied to clipboard
fun CommunicationManager(listener: Communication, onResponse: (String) -> Unit)

Functions

handleMessage
Link copied to clipboard
fun handleMessage(message: String)

Call this method when the PWA sends a new JSON message. The CommunicationManager automatically invokes the correct Communication handler.

Properties

listener
Link copied to clipboard
val listener: Communication

Register the Communication listener that invokes the correct message handler when a new PWA message arrives.

onResponse
Link copied to clipboard
val onResponse: (String) -> Unit

Called when the response JSON string should be sent to the PWA.