logout static method
void
logout({
- required dynamic onSuccess(),
- required dynamic onError(),
Logs out of the CometChat Calls SDK. Clears all stored credentials and session data. Requirements: 2.8
Implementation
static void logout(
{required Function(String onSuccess) onSuccess,
required Function(CometChatCallsException excep) onError}) async {
try {
ApiConnection().logout((success) {
_internalLogOut();
_notifyLogoutSuccess();
onSuccess(ErrorMessageConstants.messageLogOutSuccess);
}, (error) {
_internalLogOut();
_notifyLogoutSuccess();
onSuccess(ErrorMessageConstants.messageLogOutSuccess);
});
} catch (e) {
final exception = CometChatCallsException.wrapUnhandled(e);
_internalLogOut();
_notifyLogoutFailure(exception);
onError(exception);
}
}