public typealias SyncUser = RLMSyncUser
Log in a user and asynchronously retrieve a user object.
If the log in completes successfully, the completion block will be called, and a
SyncUserrepresenting the logged-in user will be passed to it. This user object can be used to open
Realms and retrieve
SyncSessions. Otherwise, the completion block will be called with an error.
SyncCredentialsobject representing the user to log in.
The URL of the authentication server (e.g.
How long the network client should wait, in seconds, before timing out.
The dispatch queue upon which the callback should run. Defaults to the main queue.
A callback block to be invoked once the log in completes.
An optional error handler which can be set to notify the host application when the user encounters an error.
.invalidAccessTokento see if the user has been remotely logged out because its refresh token expired, or because the third party authentication service providing the user’s identity has logged the user out.
Regardless of whether an error handler is defined, certain user errors will automatically cause the user to enter the logged out state.
Retrieve permissions for this user. Permissions describe which synchronized Realms this user has access to and what they are allowed to do with them.
Permissions are retrieved asynchronously and returned via the callback. The callback is run on the same thread that the method is invoked upon.
This method must be invoked on a thread with an active run loop.
Do not pass the
Resultsreturned by the callback between threads.
A callback providing either a
Resultscontaining the permissions, or an error describing what went wrong.
Create a permission offer for a Realm.
A permission offer is used to grant access to a Realm this user manages to another user. Creating a permission offer produces a string token which can be passed to the recepient in any suitable way (for example, via e-mail).
The operation will take place asynchronously. The token can be accepted by the recepient using the
The URL of the Realm for which the permission offer should pertain. This may be the URL of any Realm which this user is allowed to manage. If the URL has a
~wildcard it will be replaced with this user’s user identity.
What access level to grant to whoever accepts the token.
Optionally, a date which indicates when the offer expires. If the recepient attempts to accept the offer after the date it will be rejected. If nil, the offer will never expire.
A callback indicating whether the operation succeeded or failed. If it succeeded the token will be passed in as a string.