RLMApp
@interface 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 }
-
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
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;
-
Use this delegate to be provided a callback once authentication has succeed or failed.
Declaration
Objective-C
@property (nonatomic, weak, nullable) id<RLMASLoginDelegate> authorizationDelegate;
Swift
weak var authorizationDelegate: RLMASLoginDelegate? { get set }
-
Sets the ASAuthorizationControllerDelegate to be handled by
RLMApp
Declaration
Objective-C
- (void)setASAuthorizationControllerDelegateForController: (nonnull ASAuthorizationController *)controller;
Parameters
controller
The ASAuthorizationController in which you want
RLMApp
to consume its delegate.