login and logout events. This can be achieved using the LoginListener class provided. LoginListener consists of 4 events that can be triggered. These are as follows:
| Delegate Method | Information |
|---|---|
| loginSuccess(event) | Informs you that the login was successful and provides you with a user object containing the data for the user that logged in. |
| loginFailure(event) | Informs you about the failure while logging in the user and provides you with the reason for the failure wrapped in an object of the CometChatException class. |
| logoutSuccess() | Informs you about the user being logged out successfully. |
| logoutFailure(event) | Informs you about the failure while logging out the user. The reason for the failure can be obtained from the object of the CometChatException class. |
LoginListener, you need to use the addLoginListener() method provided by the SDK which takes a unique identifier for the listener and of the the LoginListener class itself.
- JavaScript
- TypeScript
- JavaScript
- TypeScript