create

Creates a sync configuration for Flexible Sync with default values for all optional configuration parameters.

Flexible Sync uses a concept called subscription sets to define which data gets uploaded and downloaded to the device. See SubscriptionSet for more information.

See: Flexible Sync

Parameters

user

the User who controls the realm.

schema

the classes of the schema. The elements of the set must be direct class literals.

Throws

if the user is not valid and logged in.


fun create(user: User, partitionValue: String?, schema: Set<KClass<out BaseRealmObject>>): SyncConfiguration
fun create(user: User, partitionValue: Int?, schema: Set<KClass<out BaseRealmObject>>): SyncConfiguration

Creates a sync configuration for Partition-based Sync with default values for all optional configuration parameters.

See: Partitions

Parameters

user

the User who controls the realm.

partitionValue

the partition value that defines which data to sync to the realm.

schema

the classes of the schema. The elements of the set must be direct class literals.

Throws

if the user is not valid and logged in.


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

Creates a sync configuration for Partition-based Sync with default values for all optional configuration parameters.

Parameters

user

the User who controls the realm.

partitionValue

the partition value that defines which data to sync to the realm.

schema

the classes of the schema. The elements of the set must be direct class literals.

Throws

if the user is not valid and logged in.


fun create(user: User, partitionValue: BsonObjectId?, schema: Set<KClass<out BaseRealmObject>>): SyncConfiguration
fun create(user: User, partitionValue: RealmUUID?, schema: Set<KClass<out BaseRealmObject>>): SyncConfiguration

Creates a sync configuration for Partition-based Sync with default values for all optional configuration parameters.

Parameters

user

the User who controls the realm.

partitionValue

the partition value that defines which data to sync to the realm.

schema

the classes of the schema. The elements of the set must be direct class literals.

Throws

if the user is not valid and logged in.