sendBroadcastMessage method

Future<ZegoIMSendBroadcastMessageResult> sendBroadcastMessage(
  1. String roomID,
  2. String message
)

Sends a Broadcast Message.

Available since: 1.2.1 Description: Send a broadcast message to the room, users who have entered the same room can receive the message, and the message is reliable. Use cases: Generally used when the number of people in the live room does not exceed 500. When to call: After calling loginRoom to log in to the room. Restrictions: It is not supported when the number of people online in the room exceeds 500. If you need to increase the limit, please contact ZEGO technical support to apply for evaluation. The frequency of sending broadcast messages in the same room cannot be higher than 10 messages/s. The maximum QPS for a single user calling this interface from the client side is 2. For restrictions on the use of this function, please contact ZEGO technical support. Related callbacks: The room broadcast message can be received through onIMRecvBroadcastMessage. Related APIs: Barrage messages can be sent through the sendBarrageMessage function, and custom command can be sent through the sendCustomCommand function.

  • roomID Room ID, a string of up to 128 bytes in length. Caution:
    1. room ID is defined by yourself.
    2. Only support numbers, English characters and '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '=', '-', '`', ';', '’', ',', '.', '<', '>', '/', ''.
    3. If you need to communicate with the Web SDK, please do not use '%'.
  • message The content of the message. Required: Yes. Value range: The length does not exceed 1024 bytes.
  • Returns Send broadcast message result callback

Implementation

Future<ZegoIMSendBroadcastMessageResult> sendBroadcastMessage(
    String roomID, String message) async {
  return await ZegoExpressImpl.instance.sendBroadcastMessage(roomID, message);
}