Builder

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

Constructors

Link copied to clipboard
constructor(user: User, schema: Set<KClass<out BaseRealmObject>>)

Creates a SyncConfiguration.Builder for Flexible Sync. Flexible Sync must be enabled on the server for this to work.

constructor(user: User, partitionValue: ObjectId?, schema: Set<KClass<out BaseRealmObject>>)

Creates a SyncConfiguration.Builder for Partition-Based Sync. Partition-Based Sync must be enabled on the server for this to work.

constructor(user: User, partitionValue: BsonObjectId?, schema: Set<KClass<out BaseRealmObject>>)

Creates a SyncConfiguration.Builder for Partition-Based Sync. Partition-Based Sync must be enabled on the server for this to work.

constructor(user: User, partitionValue: RealmUUID?, schema: Set<KClass<out BaseRealmObject>>)

Creates a SyncConfiguration.Builder for Partition-Based Sync. Partition-Based Sync must be enabled on the server for this to work.

constructor(user: User, partitionValue: Int?, schema: Set<KClass<out BaseRealmObject>>)

Creates a SyncConfiguration.Builder for Partition-Based Sync. Partition-Based Sync must be enabled on the server for this to work.

constructor(user: User, partitionValue: Long?, schema: Set<KClass<out BaseRealmObject>>)

Creates a SyncConfiguration.Builder for Partition-Based Sync. Partition-Based Sync must be enabled on the server for this to work.

constructor(user: User, partitionValue: String?, schema: Set<KClass<out BaseRealmObject>>)

Creates a SyncConfiguration.Builder for Partition-Based Sync. Partition-Based Sync must be enabled on the server for this to work.

Functions

Link copied to clipboard
open override fun build(): SyncConfiguration
Link copied to clipboard
Link copied to clipboard

Sets the error handler used by Synced Realms when reporting errors with their session.

Link copied to clipboard
Link copied to clipboard
fun initialRealmFile(assetFile: String, sha256checkSum: String?): SyncConfiguration.Builder
Link copied to clipboard
fun initialSubscriptions(rerunOnOpen: Boolean = false, initialSubscriptionBlock: InitialSubscriptionsCallback): SyncConfiguration.Builder

Define the initial io.realm.mongodb.sync.SubscriptionSet for the Realm. This will only be executed the first time the Realm file is opened (and the file created).

Link copied to clipboard
Link copied to clipboard
open override fun log(level: LogLevel, customLoggers: List<RealmLogger>): SyncConfiguration.Builder
Link copied to clipboard
open override fun name(name: String): SyncConfiguration.Builder

Sets the filename of the realm file.

Link copied to clipboard
Link copied to clipboard

Sets the strategy that would handle the client reset by this synced Realm.

Link copied to clipboard

Setting this will cause the Realm to download all known changes from the server the first time a Realm is opened. The Realm will not open until all the data has been downloaded. This means that if a device is offline the Realm will not open.