Builder

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

Constructors

Builder
Link copied to clipboard
fun Builder(user: User, schema: Set<KClass<out BaseRealmObject>>)
Creates a SyncConfiguration.Builder for Flexible Sync.
Builder
Link copied to clipboard
fun Builder(user: User, partitionValue: ObjectId?, schema: Set<KClass<out BaseRealmObject>>)
Creates a SyncConfiguration.Builder for Partition-Based Sync.
Builder
Link copied to clipboard
fun Builder(user: User, partitionValue: BsonObjectId?, schema: Set<KClass<out BaseRealmObject>>)
Creates a SyncConfiguration.Builder for Partition-Based Sync.
Builder
Link copied to clipboard
fun Builder(user: User, partitionValue: RealmUUID?, schema: Set<KClass<out BaseRealmObject>>)
Creates a SyncConfiguration.Builder for Partition-Based Sync.
Builder
Link copied to clipboard
fun Builder(user: User, partitionValue: Int?, schema: Set<KClass<out BaseRealmObject>>)
Creates a SyncConfiguration.Builder for Partition-Based Sync.
Builder
Link copied to clipboard
fun Builder(user: User, partitionValue: Long?, schema: Set<KClass<out BaseRealmObject>>)
Creates a SyncConfiguration.Builder for Partition-Based Sync.
Builder
Link copied to clipboard
fun Builder(user: User, partitionValue: String?, schema: Set<KClass<out BaseRealmObject>>)
Creates a SyncConfiguration.Builder for Partition-Based Sync.

Functions

build
Link copied to clipboard
open override fun build(): SyncConfiguration
compactOnLaunch
Link copied to clipboard
fun compactOnLaunch(callback: CompactOnLaunchCallback): SyncConfiguration.Builder
encryptionKey
Link copied to clipboard
fun encryptionKey(encryptionKey: ByteArray): SyncConfiguration.Builder
errorHandler
Link copied to clipboard
fun errorHandler(errorHandler: SyncSession.ErrorHandler): SyncConfiguration.Builder
Sets the error handler used by Synced Realms when reporting errors with their session.
initialData
Link copied to clipboard
fun initialData(callback: InitialDataCallback): SyncConfiguration.Builder
initialRealmFile
Link copied to clipboard
fun initialRealmFile(assetFile: String, sha256checkSum: String?): SyncConfiguration.Builder
initialSubscriptions
Link copied to clipboard
fun initialSubscriptions(rerunOnOpen: Boolean = false, initialSubscriptionBlock: InitialSubscriptionsCallback): SyncConfiguration.Builder
Define the initial io.realm.mongodb.sync.
inMemory
Link copied to clipboard
fun inMemory(): SyncConfiguration.Builder
log
Link copied to clipboard
open override fun log(level: LogLevel, customLoggers: List<RealmLogger>): SyncConfiguration.Builder
maxNumberOfActiveVersions
Link copied to clipboard
fun maxNumberOfActiveVersions(maxVersions: Long): SyncConfiguration.Builder
name
Link copied to clipboard
open override fun name(name: String): SyncConfiguration.Builder
Sets the filename of the realm file.
schemaVersion
Link copied to clipboard
fun schemaVersion(schemaVersion: Long): SyncConfiguration.Builder
syncClientResetStrategy
Link copied to clipboard
fun syncClientResetStrategy(resetStrategy: SyncClientResetStrategy): SyncConfiguration.Builder
Sets the strategy that would handle the client reset by this synced Realm.
waitForInitialRemoteData
Link copied to clipboard
fun waitForInitialRemoteData(timeout: Duration = Duration.INFINITE): SyncConfiguration.Builder
Setting this will cause the Realm to download all known changes from the server the first time a Realm is opened.