sendMessage

fun sendMessage(coroutineScope: CoroutineScope, castSession: CastSession, message: String, messageName: MessageName, namespace: String = DEFAULT_NAMESPACE, messageStatusHandler: (messageName: MessageName, result: Result<String, Error>) -> Unit)

Sends message to the receiver application.

Parameters

coroutineScope

The CoroutineScope instance.

castSession

current CastSession instance.

message

The message payload to send.

messageName

The MessageName instance.

messageStatusHandler

The lambda function that handles message sending and receiving status

namespace

The namespace for the message.