SyncConfiguration

interface SyncConfiguration

A SyncConfiguration is used to setup a Realm Database that can be synchronized between devices using Atlas Device Sync.

A valid User is required to create a SyncConfiguration. See Credentials and App.login for more information on how to get a user object.

A minimal SyncConfiguration can be found below.

    val app = App.create(appId)
val user = app.login(Credentials.anonymous())
val config = SyncConfiguration.create(user, "partition-value", setOf(YourRealmObject::class))
val realm = Realm.open(config)

Types

Builder
Link copied to clipboard
class Builder

Used to create a SyncConfiguration. For common use cases, a SyncConfiguration can be created using the SyncConfiguration.create function.

Companion
Link copied to clipboard
object Companion

Properties

errorHandler
Link copied to clipboard
abstract val errorHandler: SyncSession.ErrorHandler
initialRemoteData
Link copied to clipboard
abstract val initialRemoteData: InitialRemoteDataConfiguration?

Configuration options if downloading initial data from the server has been enabled for this realm.

initialSubscriptions
Link copied to clipboard
abstract val initialSubscriptions: InitialSubscriptionsConfiguration?

Configuration options if initial subscriptions have been enabled for this realm.

syncClientResetStrategy
Link copied to clipboard
abstract val syncClientResetStrategy: SyncClientResetStrategy

Strategy used to handle client reset scenarios.

syncMode
Link copied to clipboard
abstract val syncMode: SyncMode

The mode of synchronization for this realm.

user
Link copied to clipboard
abstract val user: User