CometChat getLoggedInUser doesn't fetch new details after user has been updated


After updating user details using CometChat.updateUser(), calling CometChat.getLoggedInUser() does not return updated user values.

The user list in the CometChat dashboard is updated and I have tried calling CometChat.init() and CometChat.login() again but getLoggedInUser() is never updated with the new user details.

Is there a function to get getLoggedInUser() to fetch the latest user details?

Hi @jlieow,

You can use CometChat.getUser() to get the latest details of any users.

Please refer to the below code to get the latest details of the logged-in user.

CometChat.getUser(CometChat.getLoggedInUser().getUid(), new CometChat.CallbackListener<User>() {
                public void onSuccess(User user) {
                    //Your Success Code

                public void onError(CometChatException e) {

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.