SyncConfiguration
public struct SyncConfiguration
A SyncConfiguration
represents configuration parameters for Realms intended to sync with
a Realm Object Server.
-
The URL of the Realm on the Realm Object Server that this configuration should open.
Warning
The URL must be absolute (e.g.realms://example.com/~/foo
), and cannot end with.realm
,.realm.lock
or.realm.management
.Declaration
Swift
public let realmURL: URL
-
Whether the SSL certificate of the Realm Object Server should be validated.
Declaration
Swift
public let enableSSLValidation: Bool
-
Whether this Realm should be opened in ‘partial synchronization’ mode. Partial synchronization mode means that no objects are synchronized from the remote Realm except those matching queries that the user explicitly specifies.
-warning: Partial synchronization is a tech preview. Its APIs are subject to change.
Declaration
Swift
public var isPartial: Bool
-
Whether this Realm should be a fully synchronized Realm.
Synchronized Realms comes in two flavors: Query-based and Fully synchronized. A fully synchronized Realm will automatically synchronize the entire Realm in the background while a query-based Realm will only synchronize the data being subscribed to. Synchronized realms are by default query-based unless this boolean is set.
Declaration
Swift
public let fullSynchronization: Bool
-
The prefix that is prepended to the path in the HTTP request that initiates a sync connection. The value specified must match with the server’s expectation. Changing the value of
urlPrefix
should be matched with a corresponding change of the server’s configuration. If no value is specified here then the default/realm-sync
path is used.Declaration
Swift
public let urlPrefix: String?
-
Initialize a sync configuration with a user and a Realm URL.
Additional settings can be optionally specified. Descriptions of these settings follow.
enableSSLValidation
is true by default. It can be disabled for debugging purposes.Warning
The URL must be absolute (e.g.
realms://example.com/~/foo
), and cannot end with.realm
,.realm.lock
or.realm.management
.Warning
NEVER disable SSL validation for a system running in production.
Declaration
Swift
public init(user: SyncUser, realmURL: URL, enableSSLValidation: Bool = true, isPartial: Bool = false, urlPrefix: String? = nil)
-
Return a Realm configuration for syncing with the default Realm of the given sync user.
Partial synchronization is enabled in the returned configuration.