RLMSyncConfiguration
@interface RLMSyncConfiguration : NSObject
A configuration object representing configuration state for a Realm which is intended to sync with a Realm Object Server.
-
The user to which the remote Realm belongs.
Declaration
Objective-C
@property (readonly, nonatomic) RLMSyncUser *_Nonnull user;
Swift
var user: RLMSyncUser { get }
-
The URL of the remote Realm upon the Realm Object Server.
Warning
The URL cannot end with.realm
,.realm.lock
or.realm.management
.Declaration
Objective-C
@property (readonly, nonatomic) NSURL *_Nonnull realmURL;
Swift
var realmURL: URL { get }
-
Whether SSL certificate validation is enabled for the connection associated with this configuration value. SSL certificate validation is ON by default.
Warning
NEVER disable certificate validation for clients and servers in production.Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL enableSSLValidation;
Swift
var enableSSLValidation: Bool { get set }
-
Whether this Realm should be opened in ‘Query-based synchronization’ mode. Query-based synchronization mode means that no objects are synchronized from the remote Realm except those matching queries that the user explicitly specifies.
Warning
Query-based synchronization is a tech preview. Its APIs are subject to change.Declaration
Objective-C
@property (assign, readwrite, nonatomic) BOOL isPartial;
Swift
var isPartial: Bool { get set }
-
Create a sync configuration instance.
Declaration
Objective-C
- (nonnull instancetype)initWithUser:(nonnull RLMSyncUser *)user realmURL:(nonnull NSURL *)url;
Swift
init(user: RLMSyncUser, realmURL url: URL)
Parameters
user
A
RLMSyncUser
that owns the Realm at the given URL.url
The unresolved absolute URL to the Realm on the Realm Object Server, e.g.
realm://example.org/~/path/to/realm
.Unresolved
means the path should contain the wildcard marker~
, which will automatically be filled in with the user identity by the Realm Object Server. -
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.
Declaration
Objective-C
+ (nonnull RLMRealmConfiguration *)automaticConfiguration;
Swift
class func automaticConfiguration() -> RLMRealmConfiguration
-
Return a Realm configuration for syncing with the default Realm of the given sync user.
Query-based synchronization is enabled in the returned configuration.
Declaration
Objective-C
+ (nonnull RLMRealmConfiguration *)automaticConfigurationForUser: (nonnull RLMSyncUser *)user;
Swift
class func automaticConfiguration(for user: RLMSyncUser) -> RLMRealmConfiguration