SyncUser

public typealias SyncUser = RLMSyncUser
  • Given credentials and a server URL, log in a user and asynchronously return a SyncUser object which can be used to open Realms and retrieve SyncSessions.

    Declaration

    Swift

    public static func logIn(with credentials: SyncCredentials,
                                 server authServerURL: URL,
                                 timeout: TimeInterval = 30,
                                 onCompletion completion: @escaping UserCompletionBlock)
  • all

    A dictionary of all valid, logged-in user identities corresponding to their SyncUser objects.

    Declaration

    Swift

    public static var all: [String: SyncUser]
  • The logged-in user. nil if none exists. Only use this property if your application expects no more than one logged-in user at any given time.

    Warning

    Throws an Objective-C exception if more than one logged-in user exists.

    Declaration

    Swift

    public static var current: SyncUser?
  • Returns an instance of the Management Realm owned by the user.

    This Realm can be used to control access permissions for Realms managed by the user. This includes granting other users access to Realms.

    Declaration

    Swift

    public func managementRealm() throws -> Realm
  • Returns an instance of the Permission Realm owned by the user.

    This read-only Realm contains SyncPermission objects reflecting the synchronized Realms and permission details this user has access to.

    Declaration

    Swift

    public func permissionRealm() throws -> Realm