Get Current User

You can obtain the details of the current end user of your application by calling the getCurrentUser() method. Upon successful execution, this method will return the current user object. You can fetch the user’s details that are registered in Catalyst, such as their first name, last name, or email address, using this.

The code syntax for obtaining the current user is given below:

    
copy
ZCatalystApp.getInstance().getCurrentUser( success: (ZCatalystUser) → Unit, failure: ((ZCatalystException) → Unit)? ): ZCatalystRequest<ZCatalystResponse<ZCatalystUser>>?

A sample code snippet is shown below:

    
copy
ZCatalystApp.getInstance().getCurrentUser( { user -> println("The current user is : ${user.firstName}") }, { exception -> println("Get current user failed! $exception") } )

Last Updated 2023-09-03 01:06:41 +0530 +0530

ON THIS PAGE