add Connection Status Handler
Adds a connection status handler.
Notifies via ConnectionStatusHandler.onConnectionStatusChanged when the connection status changes.
NCEngine.addConnectionStatusHandler("CONNECTION_HANDLER_ID") { event ->
when (event.status) {
ConnectionStatus.CONNECTED -> println("Connected")
ConnectionStatus.SUSPENDED -> println("Connection suspended")
else -> println("Status: ${event.status}")
}
}Content copied to clipboard
Parameters
identifier
Unique identifier for the handler, used for subsequent removal
handler
Connection status handler