onIMRecvBroadcastMessage method
The callback triggered when Broadcast Messages are received.
Available since: 1.2.1
Description: This callback is used to receive broadcast messages sent by other users in the same room.
Use cases: Generally used when the number of people in the live room does not exceed 500
When to trigger: After calling loginRoom
to log in to the room, if a user in the room sends a broadcast message via sendBroadcastMessage
function, this callback will be triggered.
Restrictions: None
Caution: The broadcast message sent by the user will not be notified through this callback.
Related callbacks: You can receive room barrage messages through onIMRecvBarrageMessage, and you can receive room custom signaling through onIMRecvCustomCommand.
roomID
Room ID. Value range: The maximum length is 128 bytes.messageList
List of received messages. Value range: Up to 50 messages can be received each time.
Implementation
void onIMRecvBroadcastMessage(
String roomID,
List<ZegoBroadcastMessageInfo> messageList,
) {}