App
-
Login to a user for the Realm app.
@param credentials The credentials identifying the user. @param completion A callback invoked after completion. Will return
Result.success(User)
orResult.failure(Error)
.Declaration
Swift
func login(credentials: Credentials, _ completion: @escaping (Result<User, Error>) -> Void)
-
Sets the ASAuthorizationControllerDelegate to be handled by
App
Usage:
let app = App(id: "my-app-id") let appleIDProvider = ASAuthorizationAppleIDProvider() let request = appleIDProvider.createRequest() request.requestedScopes = [.fullName, .email] let authorizationController = ASAuthorizationController(authorizationRequests: [request]) app.setASAuthorizationControllerDelegate(controller: authorizationController) authorizationController.presentationContextProvider = self authorizationController.performRequests()
Declaration
Swift
public func setASAuthorizationControllerDelegate(for controller: ASAuthorizationController)
Parameters
controller
The ASAuthorizationController in which you want
App
to consume its delegate. -
A publisher that emits Void each time the app changes.
Despite the name, this actually emits after the app has changed.
Declaration
Swift
public var objectWillChange: AppPublisher { get }
-
Login to a user for the Realm app. @param credentials The credentials identifying the user. @returns A publisher that eventually return
User
orError
.Declaration
Swift
func login(credentials: Credentials) -> Future<User, Error>