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.

Create a scheduled message

You can create a scheduled user message to send at a later time by passing ScheduledUserMessageCreateParams as an argument to the createScheduledUserMessage() method.

// Create a scheduled user message.
let params = ScheduledUserMessageCreateParams(
    scheduledAt: SCHEDULED_AT_MILLISECONDS,
    message: MESSAGE_TEXT
)
groupChannel.createScheduledUserMessage(params: params) { message, error in
    guard error == nil else {
        return // Handle error.
    }
}

You can create a scheduled file message to send at a later time by passing ScheduledFileMessageCreateParams as an argument to the createScheduledFileMessage() method.

// Create a scheduled file message.
let params = ScheduledFileMessageCreateParams(
    scheduledAt: SCHEDULED_AT_MILLISECONDS, 
    file: FILE_DATA
)
params.fileName = FILE_NAME
params.fileSize = FILE_SIZE
params.mimeType = MIME_TYPE
groupChannel.createScheduledFileMessage(params: params) { message, error in
    guard error == nil else {
        return // Handle error.
    }
}