Backup and Restore
Backup and Restore is a feature which allows users to backup the chats and able to restore chats.
Backup your chat#
Whenever you need to backup your chat messages, you can use the below method to start backup. The method will backup all the chats and writes to a file. Once backup completed you can get the backup file path from the backupDidFinish callback delegate.
| Argument | Type | Description |
|---|---|---|
| enableEncryption | Bool | if it is true file encryption will be enabled or else none |
| Callback | BackupEventDelegate | Backup progress and completeion |
| enableEncryption | if it is true file encryption will be enabled or else none |
info
The backup progress and completion callback BackupEventDelegate.
Note : To check if message is available use this method BackupManager.shared.checkIfMessageAvailable().
Restore from a backup file#
Whenever you need to restore the chat messages from the backup file, you can use the below method.
| Argument | Type | Description |
|---|---|---|
| URL | URL | Backup file local path url |
| Callback | RestoreEventDelegate | Restore progress and completeion |
info
The backup progress and completion callback RestoreEventDelegate.
To cancel backup#
Stops the current backup process if one is running. Use this to cancel a backup when it's no longer needed.
To cancel restore#
Stops the current restore process if it's in progress. Use this to cancel a restore operation when it's no longer needed or should be interrupted.