BaasUser

public class BaasUser: NSObject, NSCoding

class BaasUser

manages the BaasBox logged in user

You can get the user data and manages it from here

  • Decodes the saved object

    Declaration

    Swift

    required convenience public init?(coder aDecoder: NSCoder)
  • Encodes the saved object

    Declaration

    Swift

    public func encode(with aCoder: NSCoder)
  • Returns a bool if the user is locally authenticated

    • return: Boolean for local authentication

    Declaration

    Swift

    public func isAuthenticated() -> Bool
  • Upload the saved user updates to the BaasBox server

    Declaration

    Swift

    public func update(completion: BaasBox.BaasCompletion)
  • Logout function, will call the function you pass in logoutStrategy on completion

    Declaration

    Swift

    public func logout(pushToken: String = "",completion: BaasBox.BaasCompletion )
  • Refresh the saved data of the user from the server

    Declaration

    Swift

    public func refresh(completion: BaasBox.BaasCompletion )
  • Change the user password.

    NOTE:

    Your session code will change

    • parameters:
      • from : Old password
      • to : New password

    Declaration

    Swift

    public func changePassword(from: String, to: String, completion: BaasBox.BaasCompletion)

    Parameters

    from

    Old password

    to

    New password

  • Link the user with a social login

    • parameters:
      • to: BaasBox.socialTypes, the type of the social login
      • token: The token provided by the third party social sdk

    Declaration

    Swift

    public func link(to: BaasBox.socialTypes, token: String, completion: BaasBox.BaasCompletion)

    Parameters

    to

    BaasBox.socialTypes, the type of the social login

    token

    The token provided by the third party social sdk