Chat / iOS
Chat iOS v4
Chat iOS
Chat
iOS
Home
/
Chat
/
iOS
/
Message
This is the new Docs for Chat SDK v4 for iOS. To see the previous Docs, click here.

Copy a message

A user can copy and send their own message in the same channel or to another channel. This works the same way for both open channels and group channels.

User message

channel.copyUserMessage(MESSAGE_TO_COPY, toTargetChannel: TARGET_CHANNEL) { (userMessage, error) in
    guard error == nil else {
        // Handle error.
        return
    }

    // The message is successfully copied to the target channel.
}

File message

channel.copyFileMessage(MESSAGE_TO_COPY, toTargetChannel: TARGET_CHANNEL) { (fileMessage, error) in
    guard error == nil else {
        // Handle error.
        return
    }

    // The message is successfully copied to the target channel.
}

List of parameters

Parameter nameTypeDescription

message

UserMessage, FileMessage

Specifies a message to copy.

toTargetChannel

BaseChannel

Specifies a target channel to send a copied message to.

completionHandler

Closure

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