Skip to main content

Class: Message

  • cast.framework.system.Message represents a custom message received from a sender.

  • Custom messages can be listened for using the cast.framework.CastReceiverContext#addCustomMessageListener method.

  • The Message class has a constructor that takes the message type, sender ID, and data as parameters.

  • Key properties of a Message include data (the payload), senderId (the sender's ID), and type (always "message").

cast.framework.system.Message

class static

A custom message received from a sender. To listen for custom events use the cast.framework.CastReceiverContext#addCustomMessageListener method.

Constructor

Message

new Message(type, senderId, data)

Parameter

type

string

The message type. It is always "message".

senderId

string

The sender ID.

data

any type

The message payload.

Value must not be null.

Properties

data

constant

non-null any type

The message payload.

senderId

constant

string

The sender ID.

type

The message type. It is always "message".

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024年09月18日 UTC.

AltStyle によって変換されたページ (->オリジナル) /