Show / Hide Table of Contents

    Class SyncConfigurationBase

    A SyncConfigurationBase is used to setup a Realm that can be synchronized between devices using the Realm Object Server.

    Inheritance
    Object
    RealmConfigurationBase
    SyncConfigurationBase
    FullSyncConfiguration
    QueryBasedSyncConfiguration
    Inherited Members
    RealmConfigurationBase.DefaultRealmName
    RealmConfigurationBase.DatabasePath
    RealmConfigurationBase.IsDynamic
    RealmConfigurationBase.ObjectClasses
    RealmConfigurationBase.GetPathToRealm(String)
    RealmConfigurationBase.SchemaVersion
    RealmConfigurationBase.EncryptionKey
    Namespace: Realms.Sync
    Assembly: Realm.dll
    Syntax
    public abstract class SyncConfigurationBase : RealmConfigurationBase

    Properties

    | Improve this Doc View Source

    CustomLogger

    Gets or sets a custom log function that will be invoked by Sync instead of writing to the standard error. This must be set before using any of the sync API.

    Declaration
    public static Action<string, LogLevel> CustomLogger { get; set; }
    Property Value
    Type Description
    Action<String, LogLevel>

    The custom log function.

    Remarks

    This callback will not be invoked in a thread-safe manner, so it's up to the implementor to ensure that log messages arriving from multiple threads are processed without garbling the final output.

    | Improve this Doc View Source

    EnableSSLValidation

    Gets or sets a value indicating whether SSL certificate validation is enabled for the connection associated with this configuration value.

    Declaration
    public bool EnableSSLValidation { get; set; }
    Property Value
    Type Description
    Boolean

    true if SSL validation is enabled; otherwise, false. Default value is true.

    | Improve this Doc View Source

    LogLevel

    Gets or sets a value indicating how detailed the sync client's logs will be.

    Declaration
    public static LogLevel LogLevel { get; set; }
    Property Value
    Type Description
    LogLevel
    | Improve this Doc View Source

    OnProgress

    Gets or sets a callback that is invoked when download progress is made when using GetInstanceAsync(RealmConfigurationBase, CancellationToken). This will only be invoked for the initial download of the Realm and will not be invoked as futher download progress is made during the lifetime of the Realm. It is ignored when using GetInstance(RealmConfigurationBase).

    Declaration
    public Action<SyncProgress> OnProgress { get; set; }
    Property Value
    Type Description
    Action<SyncProgress>
    | Improve this Doc View Source

    ServerUri

    Gets the Uri used to create this SyncConfigurationBase.

    Declaration
    public Uri ServerUri { get; }
    Property Value
    Type Description
    Uri

    The Uri where the Realm Object Server is hosted.

    | Improve this Doc View Source

    TrustedCAPath

    Gets or sets the path to the trusted root certificate(s) authority (CA) in PEM format, that should be used to validate the TLS connections to the Realm Object Server.

    Declaration
    public string TrustedCAPath { get; set; }
    Property Value
    Type Description
    String

    The path to the certificate.

    Remarks

    The file will be copied at runtime into the internal storage.
    It is recommended to include only the root CA you trust, and not the entire list of root CA as this file will be loaded at runtime. It is your responsibility to download and verify the correct PEM for the root CA you trust.
    This property is ignored on Apple platforms - you should use the KeyChain API to install your certificate instead.

    See Also
    OpenSSL documentation for SSL_CTX_load_verify_locations.
    Mozilla Included CA Certificate List
    | Improve this Doc View Source

    User

    Gets the User used to create this SyncConfigurationBase.

    Declaration
    public User User { get; }
    Property Value
    Type Description
    User

    The User whose Realms will be synced.

    | Improve this Doc View Source

    UserAgent

    Gets or sets a string identifying this application which is included in the User-Agent header of sync connections.

    Declaration
    public static string UserAgent { get; set; }
    Property Value
    Type Description
    String

    The custom user agent that will be appended to the one generated by the SDK.

    Remarks

    This property must be set prior to opening a synchronized Realm for the first time. Any modifications made after opening a Realm will be ignored.

    Methods

    | Improve this Doc View Source

    EnableSessionMultiplexing()

    Enable multiplexing multiple sync sessions over a single connection.

    Declaration
    public static void EnableSessionMultiplexing()
    Remarks

    When having a lot of synchronized realms open, or when using Notifier the system might run out of file descriptors because of all the open sockets to the server. Session multiplexing is designed to alleviate that, but it might not work with a server configured with fail-over. Only use if you're seeing errors about reaching the file descriptor limit and you know you are using many sync sessions.

    Only call this method before opening any synchronized realms.

    | Improve this Doc View Source

    Initialize(UserPersistenceMode, Byte[], Boolean, String)

    Configures various parameters of the sync system, such as the way users are persisted or the base path relative to which files will be saved.

    Declaration
    public static void Initialize(UserPersistenceMode mode, byte[] encryptionKey = null, bool resetOnError = false, string basePath = null)
    Parameters
    Type Name Description
    UserPersistenceMode mode

    The user persistence mode.

    Byte[] encryptionKey

    The key to encrypt the persistent user store with.

    Boolean resetOnError

    If set to true reset the persistent user store on error.

    String basePath

    The base folder relative to which Realm files will be stored.

    Remarks

    Users are persisted in a realm file within the application's sandbox.

    By default User objects are persisted and are additionally protected with an encryption key stored in the iOS Keychain when running on an iOS device (but not on a Simulator). On Android users are persisted in plaintext, because the AndroidKeyStore API is only supported on API level 18 and up. You might want to provide your own encryption key on Android or disable persistence for security reasons.

    See Also

    LoginAsync(Credentials, Uri)
    Credentials
    FullSyncConfiguration
    QueryBasedSyncConfiguration
    • Improve this Doc
    • View Source
    Back to top Copyright © 2019 Realm
    Generated by DocFX