Messaging

Types

Link copied to clipboard

Smartapp backend's messages listener.

Functions

Link copied to clipboard
abstract fun addListener(listener: Messaging.Listener)

Add message listener.

Link copied to clipboard
abstract fun dispose()

Disconnect from service and clear resources.

Link copied to clipboard
abstract fun getVersion(): Int?

Returns device version service.

Link copied to clipboard

Remove message listener.

Link copied to clipboard
abstract fun sendAction(messageName: MessageName, payload: Payload, stateLevel: StateLevel = StateLevel.UNSUPPORTED, serverActionMode: ServerActionMode = ServerActionMode.FOREGROUND): MessageId

simple ServerAction example messageName: SERVER_ACTION payload: {"action_id": "GET_STREAM", "parameters": {"content_id": "111111"}}

@RequiresPermission(value = "ru.sberdevices.permission.CROSS_APP_ACTION")
abstract fun sendAction(messageName: MessageName, payload: Payload, androidApplicationID: String, stateLevel: StateLevel = StateLevel.UNSUPPORTED, serverActionMode: ServerActionMode = ServerActionMode.FOREGROUND): MessageId

Send server_action with source app androidApplicationID For internal use only.

Link copied to clipboard
abstract fun sendText(text: String)

Send text text, as if this text was spoken by user.