public void logout() {
checkConversationQueue();
if (activeConversation != null) {
switch (activeConversation.getState()) {
case LOGGED_IN:
ApptentiveLog.d(CONVERSATION, "Ending active conversation.");
EngagementModule.engageInternal(getContext(), activeConversation, "logout");
ApptentiveNotificationCenter.defaultCenter().postNotification(NOTIFICATION_CONVERSATION_WILL_LOGOUT, ObjectUtils.toMap(NOTIFICATION_KEY_CONVERSATION, activeConversation));
activeConversation.destroy();
activeConversation.setState(LOGGED_OUT);
handleConversationStateChange(activeConversation);
setActiveConversation(null);
ApptentiveInternal.dismissAllInteractions();
break;
default:
ApptentiveLog.w(CONVERSATION, "Attempted to logout() from Conversation, but the Active Conversation was not in LOGGED_IN state.");
break;
}
} else {
ApptentiveLog.w(CONVERSATION, "Attempted to logout(), but there was no Active Conversation.");
}
}