@interface RLMSyncSession : NSObject
An object encapsulating a Realm Object Server
session. Sessions represent the
communication between the client (and a local Realm file on disk), and the server
(and a remote Realm at a given URL stored on a Realm Object Server).
Sessions are always created by the SDK and vended out through various APIs. The lifespans of sessions associated with Realms are managed automatically. Session objects can be accessed from any thread.
The session’s current connection state.
This property is KVO-compliant and can be observed to be notified of changes. Be warned that KVO observers for this property may be called on a background thread.
@property (readonly, atomic) RLMSyncConnectionState connectionState;
The Realm Object Server URL of the remote Realm this session corresponds to.
@property (readonly, nonatomic, nullable) NSURL *realmURL;
Temporarily suspend syncronization and disconnect from the server.
The session will not attempt to connect to Realm Object Server until
resumeis called or the Realm file is closed and re-opened.
Resume syncronization and reconnect to Realm Object Server after suspending.
This is a no-op if the session was already active or if the session is invalid. Newly created sessions begin in the Active state and do not need to be resumed.
Register a progress notification block.
Multiple blocks can be registered with the same session at once. Each block will be invoked on a side queue devoted to progress notifications.
If the session has already received progress information from the synchronization subsystem, the block will be called immediately. Otherwise, it will be called as soon as progress information becomes available.
The token returned by this method must be retained as long as progress notifications are desired, and the
-invalidatemethod should be called on it when notifications are no longer needed and before the token is destroyed.
If no token is returned, the notification block will never be called again. There are a number of reasons this might be true. If the session has previously experienced a fatal error it will not accept progress notification blocks. If the block was configured in the
RLMSyncProgressForCurrentlyOutstandingWorkmode but there is no additional progress to report (for example, the number of transferrable bytes and transferred bytes are equal), the block will not be called again.
The transfer direction (upload or download) to track in this progress notification block.
The desired behavior of this progress notification block.
The block to invoke when notifications are available.
A token which must be held for as long as you want notifications to be delivered.