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:
copyZCatalystApp.getInstance().getCurrentUser( success: (ZCatalystUser) → Unit, failure: ((ZCatalystException) → Unit)? ): ZCatalystRequest<ZCatalystResponse<ZCatalystUser>>?
A sample code snippet is shown below:
copyZCatalystApp.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
Yes
No
Send your feedback to us
Skip
Submit