/ SDKs / Flutter
SDKs
Chat SDKs Flutter v4
Chat SDKs Flutter
Chat SDKs
Flutter
Version 4

Copy a message

Copy link

A user can copy and send their own message in the same channel or to another channel. Both user messages and file messages can be copied using the copyMessage() method.

try {
  final message = channel.copyMessage(MESSAGE_TO_COPY, TARGET_CHANNEL, handler: (message, e) {
    // MESSAGE_TO_COPY can be either UserMessage or FileMessage.
    // The message is successfully copied to the target channel.
  });
} catch (e) {
  // Handle error.
}

List of parameters

Copy link
Parameter nameTypeDescription

message

BaseMessage

Specifies a type of message to copy. Acceptable values are UserMessage or FileMessage.

targetChannel

BaseChannel

Specifies a target channel to send a copied message to.

handler

Function(BaseMessage, SendbirdException?)

Specifies the callback handler to receive the response from Sendbird server for a message copy request.