User

interface User

User operations interface, contains methods related to user.

Call prepareSession to start working HealbeSDK.

Properties

Link copied to clipboard
abstract val authData: Single<AuthData>

Get auth data for user.

Link copied to clipboard
abstract val isUserValid: Completable

Check is user valid.

Link copied to clipboard

Returns current state of user session.

Link copied to clipboard
abstract val user: Single<HealbeUser>

Get user profile data.

Link copied to clipboard
abstract val userEmail: Single<String>

Get user email.

Functions

Link copied to clipboard
abstract fun addToken(token: Token): Completable

Saves token to storage.

Link copied to clipboard
abstract fun deleteAvatar(): Completable

Delete user avatar.

Link copied to clipboard
abstract fun getAllTokens(): Single<List<Token>>

Returns all tokens from storage.

Link copied to clipboard
abstract fun getTokensByType(type: String): Single<List<Token>>

Returns all tokens of the required type from storage.

Link copied to clipboard
abstract fun hasEmailConfirmed(): Boolean

Get info about email confirmation

Link copied to clipboard
abstract fun login(eMail: String, password: String): Single<HealbeSessionState>

Log in.

Link copied to clipboard
abstract fun logout(): Completable

Logout user.

Link copied to clipboard
abstract fun observeSessionState(): Flowable<HealbeSessionState>

Get state of user session every time one is changed.

Link copied to clipboard
abstract fun observeUser(): Flowable<HealbeUser>

Get user profile data every time one is changed.

Link copied to clipboard
abstract fun prepareSession(): Single<HealbeSessionState>

Begins user session.

Link copied to clipboard
abstract fun register(eMail: String, password: String): Single<HealbeSessionState>

Register user.

Link copied to clipboard
abstract fun removeAllTokens(): Completable

Removes all tokens from storage.

Link copied to clipboard
abstract fun removeToken(token: Token): Single<Boolean>

Removes required token from storage.

Link copied to clipboard
abstract fun removeTokensByType(type: String): Single<Boolean>

Removes all tokens of the required type from storage.

Link copied to clipboard
abstract fun resendEmailConfirmation(): Completable

Send request to server for email confirmation.

Link copied to clipboard
abstract fun resetPassword(email: String): Completable

"Forgot password" request. Request server to send password on registered email.

Link copied to clipboard
abstract fun updateAvatar(avatarPath: String): Single<String>

Update user avatar.

Link copied to clipboard
abstract fun updateLocaleSettings(): Completable

Update locale settings of user (if wristband is connected also updates wristband).

Link copied to clipboard
abstract fun updateUser(userInfo: HealbeUser): Single<HealbeSessionState>

Get user profile data.