RLMApp

Objective-C

@interface RLMApp : NSObject

Swift

class RLMApp : NSObject

The RLMApp has the fundamental set of methods for communicating with a Realm application backend.

This interface provides access to login and authentication.

  • The configuration for this Realm app.

    Declaration

    Objective-C

    @property (nonatomic, readonly) RLMAppConfiguration *_Nonnull configuration;

    Swift

    var configuration: RLMAppConfiguration { get }
  • The RLMSyncManager for this Realm app.

    Declaration

    Objective-C

    @property (nonatomic, readonly) RLMSyncManager *_Nonnull syncManager;

    Swift

    var syncManager: RLMSyncManager { get }
  • Get a dictionary containing all users keyed on id.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSDictionary<NSString *, RLMUser *> *_Nonnull allUsers;

    Swift

    var allUsers: [String : RLMUser] { get }
  • Get the current user logged into the Realm app.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) RLMUser *currentUser;

    Swift

    var currentUser: RLMUser? { get }
  • A client for the email/password authentication provider which can be used to obtain a credential for logging in.

    Used to perform requests specifically related to the email/password provider.

    Declaration

    Objective-C

    @property (nonatomic, readonly) RLMEmailPasswordAuth *_Nonnull emailPasswordAuth;

    Swift

    var emailPasswordAuth: RLMEmailPasswordAuth { get }
  • Get an application with a given appId and configuration.

    Declaration

    Objective-C

    + (nonnull instancetype)appWithId:(nonnull NSString *)appId;

    Swift

    convenience init(id appId: String)

    Parameters

    appId

    The unique identifier of your Realm app.

  • Get an application with a given appId and configuration.

    Declaration

    Objective-C

    + (nonnull instancetype)appWithId:(nonnull NSString *)appId
                        configuration:(nullable RLMAppConfiguration *)configuration;

    Swift

    convenience init(id appId: String, configuration: RLMAppConfiguration?)

    Parameters

    appId

    The unique identifier of your Realm app.

    configuration

    A configuration object to configure this client.

  • Login to a user for the Realm app.

    Declaration

    Objective-C

    - (void)loginWithCredential:(nonnull RLMCredentials *)credentials
                     completion:(nonnull RLMUserCompletionBlock)completion;

    Parameters

    credentials

    The credentials identifying the user.

    completion

    A callback invoked after completion.

  • Switches the active user to the specified user.

    This sets which user is used by all RLMApp operations which require a user. This is a local operation which does not access the network. An exception will be throw if the user is not valid. The current user will remain logged in.

    Declaration

    Objective-C

    - (nonnull RLMUser *)switchToUser:(nonnull RLMUser *)syncUser;

    Swift

    func `switch`(to syncUser: RLMUser) -> RLMUser

    Parameters

    syncUser

    The user to switch to. @returns The user you intend to switch to

  • A client which can be used to register devices with the server to receive push notificatons

    Declaration

    Objective-C

    - (nonnull RLMPushClient *)pushClientWithServiceName:
        (nonnull NSString *)serviceName;

    Swift

    func pushClient(serviceName: String) -> RLMPushClient
  • Unavailable

    Use +appWithId or appWithId:configuration:.

    RLMApp instances are cached internally by Realm and cannot be created directly.

    Use +[RLMRealm appWithId] or +[RLMRealm appWithId:configuration:] to obtain a reference to an RLMApp.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Unavailable

    Use +appWithId or appWithId:configuration:.

    RLMApp instances are cached internally by Realm and cannot be created directly.

    Use +[RLMRealm appWithId] or +[RLMRealm appWithId:configuration:] to obtain a reference to an RLMApp.

    Declaration

    Objective-C

    + (nonnull instancetype)new;

ASLogin