Inherits from NSObject
Conforms to MMDBFetcherDelegate
Declared in MMLoginManager.h
MMLoginManager.m

Overview

A singleton class that is used to manage the user’s login state. This class provides methods to log a user in, log a user out, login as guest, and retrieve the current logged in user.

Class Methods

sharedLoginManager

Retrieve the singleton for the MMLoginManager.

+ (id)sharedLoginManager

Return Value

Retrieve the singleton.

Declared In

MMLoginManager.h

Instance Methods

beginLoginWithUserName:withPassword:

Begin an asynchronous call to log a user in. First, it checks to see if the user name exists on the server, then it verifies the user’s password.

- (void)beginLoginWithUserName:(NSString *)userName withPassword:(NSString *)password

Parameters

userName

The user name to login.

password

The user’s password.

Declared In

MMLoginManager.h

beginUpdateUser:

Starts an asynchronous to update a user’s profile.

- (void)beginUpdateUser:(MMUser *)userToUpdate

Parameters

userToUpdate

The user profile to update.

Declared In

MMLoginManager.h

changePasswordForUser:

Change password for user.

- (RACSignal *)changePasswordForUser:(MMUser *)user

Declared In

MMLoginManager.h

getLoggedInUser

Returns the user profile of the user that is currently logged in.

- (MMUser *)getLoggedInUser

Return Value

An MMUser object that represents the user that is currently logged in.

Declared In

MMLoginManager.h

isUserLoggedIn

Checks to see if the user is logged in.

- (BOOL)isUserLoggedIn

Return Value

Returns whether or not a user is logged in.

Declared In

MMLoginManager.h

isUserLoggedInAsGuest

Checks to see if a user is logged in as guest.

- (BOOL)isUserLoggedInAsGuest

Return Value

Returns whether or not a user is logged in as a guest.

Declared In

MMLoginManager.h

loginAsGuest

Logs a user in as a guest. All this does is create a MMUser object with it’s email property set to “kGuest”.

- (void)loginAsGuest

Declared In

MMLoginManager.h

logoutUser

Removes the current user profile from the device, which has the effect of logging the user out.

- (void)logoutUser

Declared In

MMLoginManager.h

saveUserProfileToDevice:

Serializes the specifid user’s profile to the device.

- (void)saveUserProfileToDevice:(MMUser *)user

Parameters

user

The MMUser profile to save to the device.

Declared In

MMLoginManager.h