RLMSyncManager
@interface RLMSyncManager : NSObject
A singleton manager which serves as a central point for sync-related configuration.
-
A block which can optionally be set to report sync-related errors to your application.
Any error reported through this block will be of the
RLMSyncError
type, and marked with theRLMSyncErrorDomain
domain.Errors reported through this mechanism are fatal, with several exceptions. Please consult
RLMSyncError
for information about the types of errors that can be reported through the block, and for for suggestions on handling recoverable error codes.See
RLMSyncError
Declaration
Objective-C
@property (readwrite, copy, nonatomic, nullable) RLMSyncErrorReportingBlock errorHandler;
-
A reverse-DNS string uniquely identifying this application. In most cases this is automatically set by the SDK, and does not have to be explicitly configured.
Declaration
Objective-C
@property (readwrite, copy, nonatomic) NSString *_Nonnull appID;
-
A string identifying this application which is included in the User-Agent header of sync connections. By default, this will be the application’s bundle identifier.
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.
Declaration
Objective-C
@property (readwrite, copy, nonatomic) NSString *_Nonnull userAgent;
-
The logging threshold which newly opened synced Realms will use. Defaults to
RLMSyncLogLevelInfo
.By default logging strings are output to Apple System Logger. Set
logger
to perform custom logging logic instead.Warning
This property must be set before any synced Realms are opened. Setting it after opening any synced Realm will do nothing.Declaration
Objective-C
@property (assign, readwrite, nonatomic) RLMSyncLogLevel logLevel;
-
The function which will be invoked whenever the sync client has a log message.
If nil, log strings are output to Apple System Logger instead.
Warning
This property must be set before any synced Realms are opened. Setting it after opening any synced Realm will do nothing.Declaration
Objective-C
@property (assign, readwrite, nonatomic, nullable) RLMSyncLogFunction logger;
-
The name of the HTTP header to send authorization data in when making requests to a Realm Object Server which has been configured to expect a custom authorization header.
Declaration
Objective-C
@property (readwrite, copy, nonatomic, nullable) NSString *authorizationHeaderName;
-
Extra HTTP headers to append to every request to a Realm Object Server.
Modifying this property while sync sessions are active will result in all sessions disconnecting and reconnecting using the new headers.
Declaration
Objective-C
@property (readwrite, copy, nonatomic, nullable) NSDictionary<NSString *, NSString *> *customRequestHeaders;
-
A map of hostname to file URL for pinned certificates to use for HTTPS requests.
When initiating a HTTPS connection to a server, if this dictionary contains an entry for the server’s hostname, only the certificates stored in the file (or any certificates signed by it, if the file contains a CA cert) will be accepted when initiating a connection to a server. This prevents certain certain kinds of man-in-the-middle (MITM) attacks, and can also be used to trust a self-signed certificate which would otherwise be untrusted.
On macOS, the certificate files may be in any of the formats supported by SecItemImport(), including PEM and .cer (see SecExternalFormat for a complete list of possible formats). On iOS and other platforms, only DER .cer files are supported.
For example, to pin example.com to a .cer file included in your bundle:
RLMSyncManager.sharedManager.pinnedCertificatePaths = @{ @"example.com": [NSBundle.mainBundle pathForResource:@"example.com" ofType:@"cer"] };
Declaration
Objective-C
@property (readwrite, copy, nonatomic, nullable) NSDictionary<NSString *, NSURL *> *pinnedCertificatePaths;
-
Options for the assorted types of connection timeouts for sync connections.
If nil default values for all timeouts are used instead.
Warning
This property must be set before any synced Realms are opened. Setting it after opening any synced Realm will do nothing.Declaration
Objective-C
@property (readwrite, copy, nonatomic, nullable) RLMSyncTimeoutOptions *timeoutOptions;
-
The sole instance of the singleton.
Declaration
Objective-C
+ (nonnull instancetype)sharedManager;