/ SDKs / iOS
SDKs
Chat SDKs iOS v4
Chat SDKs iOS
Chat SDKs
iOS
Version 4

Create a scheduled message

Copy link

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.
    }
}