Suspend or Resume a Sync Session - Swift SDK
On this page
Suspend or Resume a Sync Session
Opening a synced realm starts a SyncSession for that realm. You can suspend and resume the sync session on the realm. Pausing a sync session only suspends that realm's sync session. If you have more than one open realm, suspend does not affect the sync sessions for other realms.
Note
Use the .suspend()
method to control when a device syncs.
You should only use it for temporary and short-term pauses of syncing.
Examples of when to use .suspend()
include:
Syncing data only at specified time of day
Conserving device battery use
Don't use the .suspend()
method to stop syncing for
indefinite time periods or time ranges in months and years. The functionality
is not designed or tested for these use cases, and you could encounter a range of issues
when using it this way.