Class AppConfiguration
A class exposing configuration options for a App.
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
public class AppConfiguration
Constructors
| Improve this Doc View SourceAppConfiguration(String)
Initializes a new instance of the AppConfiguration class with the specified appId
.
Declaration
public AppConfiguration(string appId)
Parameters
Type | Name | Description |
---|---|---|
String | appId | The MongoDB Realm App id. |
Properties
| Improve this Doc View SourceAppId
Gets the unique app id that identifies the Realm application.
Declaration
public string AppId { get; }
Property Value
Type | Description |
---|---|
String | The MongoDB Realm App's id. |
BaseFilePath
Gets or sets the root folder relative to which all local data for this application will be stored. This data includes metadata for users and synchronized Realms.
Declaration
public string BaseFilePath { get; set; }
Property Value
Type | Description |
---|---|
String | The app's base path. |
BaseUri
Gets or sets the base url for this Realm application.
Declaration
public Uri BaseUri { get; set; }
Property Value
Type | Description |
---|---|
Uri | The app's base url. |
Remarks
This only needs to be set if for some reason your application isn't hosted on realm.mongodb.com. This can be the case if you're testing locally or are using a preproduction environment.
CustomLogger
Gets or sets a custom log function that will be invoked for each log message emitted by sync.
Declaration
public Action<string, LogLevel> CustomLogger { get; set; }
Property Value
Type | Description |
---|---|
Action<String, LogLevel> | The custom logger. |
Remarks
The first argument of the action is the log message itself, while the second one is the LogLevel at which the log message was emitted.
DefaultRequestTimeout
Gets or sets the default request timeout for HTTP requests to MongoDB Realm.
Declaration
public TimeSpan? DefaultRequestTimeout { get; set; }
Property Value
Type | Description |
---|---|
Nullable<TimeSpan> | The default HTTP request timeout. |
LocalAppName
Gets or sets the local app's name.
Declaration
public string LocalAppName { get; set; }
Property Value
Type | Description |
---|---|
String | The friendly name identifying the current client application. |
Remarks
The local app name is typically used to differentiate between client applications that use the same MongoDB Realm app. These can be the same conceptual app developed for different platforms, or significantly different client side applications that operate on the same data - e.g. an event managing service that has different clients apps for organizers and attendees.
See Also
| Improve this Doc View SourceLocalAppVersion
Gets or sets the local app's version.
Declaration
public string LocalAppVersion { get; set; }
Property Value
Type | Description |
---|---|
String | The client application's version. |
Remarks
The local app version is typically used to differentiate between versions of the same client application.
See Also
| Improve this Doc View SourceLogLevel
Gets or sets the log level for sync operations.
Declaration
public LogLevel LogLevel { get; set; }
Property Value
Type | Description |
---|---|
LogLevel | The sync log level. |
MetadataEncryptionKey
Gets or sets the encryption key for user metadata on this device.
Declaration
public byte[] MetadataEncryptionKey { get; set; }
Property Value
Type | Description |
---|---|
Byte[] | The user metadata encryption key. |
Remarks
This will not change the encryption key for individual Realms. This should still be set in EncryptionKey when opening the Realm.
MetadataPersistenceMode
Gets or sets the persistence mode for user metadata on this device.
Declaration
public MetadataPersistenceMode? MetadataPersistenceMode { get; set; }
Property Value
Type | Description |
---|---|
Nullable<MetadataPersistenceMode> | The user metadata persistence mode. |
Remarks
The default value is Encrypted for iOS devices and NotEncrypted for all other platforms. On iOS we integrate with the system keychain to generate and store a random encryption key the first time the app is launched. On other platforms, MetadataEncryptionKey needs to be set if Encrypted is specified.