clearSession method

Future<void> clearSession({
  1. bool tryLogout = true,
})

clearSession will logout, disconnect and delete the session data

Implementation

Future<void> clearSession({
  bool tryLogout = true,
}) async {
  try {
    String? sessionPath = wpClient.sessionPath;
    await disconnect(tryLogout: tryLogout);
    await DragoWhatsappFlutter.clearSession(sessionPath: sessionPath);
  } catch (e) {
    WhatsappLogger.log(e);
  }
}