onServiceStateChanged property

OnServiceStateChanged? onServiceStateChanged
getter/setter pair

Notification of message service state change.

Parameter state The service state, You can send message when state is MessageServiceState.Available.

Parameter reason The reason of the state change.

Note Send the message when the callback service status is available, otherwise sending a message when the service is unavailable may cause the message to be lost. The status callback will return immediately after joining the channel. It is recommended to set a callback before joining the channel to ensure that the service status is correctly obtained.

消息服务状态变更的通知。

Parameter state 服务状态,MessageServiceState.Available 时可以发送消息。

Parameter reason 状态变更的原因。

Note 当回调服务状态可用后再发送消息,否则当服务不可用时发送消息可能造成消息丢失。 状态回调会在加入频道后立即返回,建议在加入频道前设置回调,以确保正确获取服务状态。

Implementation

OnServiceStateChanged? onServiceStateChanged;