On this page

Restore messages

restore() recovers soft-deleted messages and their attached files. Hard-deleted messages cannot be restored.

Requires Message Persistence

Enable Message Persistence and Enable Delete-From-History in the Admin Portal.

Method signature

This method has the following signature:

1message.restore() async throws -> MessageImpl

Input

This method doesn't take any parameters.

Output

ParameterDescription
MessageImpl
Object returning the restored MessageImpl object.

Sample code

Sample code

The code samples in Swift Chat SDK focus on asynchronous code execution.

You can also write synchronous code as the parameters are shared between the async and sync methods but we don't provide usage examples of such.

Restore a previously soft deleted message with the 16200000000000001 timetoken.

1

Last updated on