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( void Function() onSuccess, void Function(ZCatalystException) onFailed )

A sample code snippet is shown below:

    
copy
try { var (response, user) = await app.getCurrentUser(); print('User ID: ${user.id}') } on ZCatalystException catch (ex) { print(ex.toString()); }

Last Updated 2024-11-19 15:58:18 +0530 +0530

ON THIS PAGE