onMessageReceived

abstract suspend fun onMessageReceived(action: String, messageContents: String): Boolean

Called when an AASB message from the AACS has been received. The implementation should process the message and handle it, based on what the application wants to do.

If this method returns true, the message will be considered handled and will not be forwarded to any other handler. Otherwise, the message will be forwarded to the next handler in order of priority.

Return

true if the message has been handled, false otherwise.

See also

for details on how the same message can be forwarded to multiple handlers.

Parameters

action

The action of the AASB JSON message. This will be one of the values defined in the Action class.

messageContents

A JSON message from Alexa. The formats of these messages are specified in the Alexa Auto AASB specification.