User Info
The Cloudike Photos SDK provides information about the current user as a UserItem
object. User manager functionality can be accessed via PhotoManager.userManager.
#
Data ModelThe user info module operates with the following data models:
- UserItem - сlass providing information about a user.
#
Get User InfoDescription
This method is intended to obtain information about the user.
Example
var disposable: Disposable? = null
// ...
disposable = PhotoManager.userManager.getUserInfo() .observeOn(AndroidSchedulers.mainThread()) .subscribeBy( onSuccess = { // it -> UserItem! // do something... }, onError = { // it -> Throwable // do something... } )
This method first tries to download user information from the cloud, save it in the local storage and return the UserItem
object. If an error occurs while downloading from the cloud, the method returns an object from the local storage.
Return - Single<UserItem>.
Links - UserItem.
#
User Info MonitoringDescription
This method provides an observer for tracking user information.
Example
var disposable: Disposable? = null
// ...
disposable = PhotoManager.userManager.getUserInfoObservable() .subscribe { // it -> UserItem! // do something.. }
Return - Observable<UserItem>.
Links - UserItem.
#
Reload User InfoDescription
This method updates user information from the backend.
Example
var disposable: Disposable? = null
// ...
disposable = PhotoManager.userManager.reloadUser() .observeOn(AndroidSchedulers.mainThread()) .subscribeBy( onComplete = { // it -> UserItem! // do something.. }, onError = { // it -> Throwable // do something.. } )
Return - Completable.
Links - UserItem.