UserManager

public class UserManager : UserManaging

The default implementation of UseManaging protocol. This class manages users of different UUID()

  • key to store all the onboarded users’ id

    Declaration

    Swift

    public static let onboardedUsersKey: String
  • key to store last onboarded user’s id

    Declaration

    Swift

    public static let lastOnboardedUserKey: String
  • key to store user’s registrations

    Declaration

    Swift

    public static let userRegistrationIDsKey: String
  • transient user

    Declaration

    Swift

    public static var transientUser: User?
  • variable to capture user mode of the application

    Declaration

    Swift

    public static var userMode: ApplicationUserMode { get set }
  • Observers registered for user events

    Declaration

    Swift

    public static var userEventObservers: [UserEventObserving] { get }
  • enum to define user modes of the apllication

    See more

    Declaration

    Swift

    public enum ApplicationUserMode : String, Equatable
  • Undocumented

    Declaration

    Swift

    public init()
  • Retrieves a User object for the given onboarding ID.

    Declaration

    Swift

    public func get(forKey onboardingID: UUID) -> User?

    Parameters

    onboardingID

    The UUID key for the user data.

    Return Value

    A User object if exist.

  • Stores a User object and manages user list updates.

    Declaration

    Swift

    public func put(onboardedUser: User?, forKey onboardingID: UUID)
  • Method to delete a user from the store based on their onboarding ID.

    Declaration

    Swift

    public func delete(forKey onboardingID: UUID)

    Parameters

    onboardingID

    The UUID representing the onboarding ID of the user to be deleted.

  • Declaration

    Swift

    public func getUsers(isActive: Bool = false) -> [User]
  • Retrieves the UUID of the current user.

    Declaration

    Swift

    @available(*, deprecated)
    public func getCurrentUser() -> UUID?

    Return Value

    The UUID of the current user, or nil if not set.

  • Retrieves the current user.

    Declaration

    Swift

    public func getCurrentUser() -> User?

    Return Value

    The User object of the current user, or nil if not set.

  • Declaration

    Swift

    public func setCurrentUser(onboardingID: UUID)
  • Identify the User from the store of successfully onboarded Users

    Declaration

    Swift

    public func identify(user: User) -> (exists: Bool, existingUser: User?)

    Parameters

    user

    a User type, which is to be identified in the store

    Return Value

    true and the User object from store or false and nil if the User does not exist in the store

  • Registers the given user event observer.

    Declaration

    Swift

    public static func register(_ userEventObserver: UserEventObserving)

    Parameters

    userEventObserver

    the observer to be registered

  • Unregisters the given user event observer.

    Declaration

    Swift

    public static func unregister(_ userEventObserver: UserEventObserving)

    Parameters

    userEventObserver

    the observer to be removed