SyncConfiguration

public struct SyncConfiguration

A SyncConfiguration represents configuration parameters for Realms intended to sync with a Realm Object Server.

  • The SyncUser who owns the Realm that this configuration should open.

    Declaration

    Swift

    public let user: SyncUser
  • 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
  • How the SSL certificate of the Realm Object Server should be validated.

    Declaration

    Swift

    public let serverValidationPolicy: ServerValidationPolicy
  • Whether the SSL certificate of the Realm Object Server should be validated.

    Warning

    This has been deprecated. Use serverValidationPolicy instead.

    Declaration

    Swift

    @available(*, deprecated, message: "Use serverValidationPolicy instead")
    public var enableSSLValidation: Bool { get }
  • 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

    This has been deprecated - use fullSyncronization instead.

    Declaration

    Swift

    @available(*, deprecated, message: "Use fullSynchronization instead")
    public var isPartial: Bool { get }
  • 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

    This has ben deprecated. Use SyncUser.configuration() instead.

    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

    @available(*, deprecated, message: "Use SyncUser.configuration(﹚ instead")
    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 currently logged-in sync user.

    Query based synchronization is enabled in the returned configuration.

    Requires

    There be exactly one logged-in SyncUser

    Warning

    This has ben deprecated. Use SyncUser.configuration() instead.

    Declaration

    Swift

    @available(*, deprecated, message: "Use SyncUser.configuration(﹚ instead")
    public static func automatic() -> Realm.Configuration
  • Return a Realm configuration for syncing with the default Realm of the given sync user.

    Partial synchronization is enabled in the returned configuration.

    Declaration

    Swift

    @available(*, deprecated, message: "Use SyncUser.configuration(﹚ instead")
    public static func automatic(user: SyncUser) -> Realm.Configuration