@Override public String toString() { return StringUtils.format("Conversation: localId=%s id=%s state=%s token=%s", getLocalIdentifier(), getConversationId(), getState(), hideIfSanitized(getConversationToken())); } }
assertEquals(conversation.getState(), ConversationState.LEGACY_PENDING);
final Conversation conversation = notification.getUserInfo(NOTIFICATION_KEY_CONVERSATION, Conversation.class); assertNotEquals(conversation.getState(), UNDEFINED); if (conversation.hasActiveState()) { final String conversationId = notNull(conversation.getConversationId()); final boolean legacyPayloads = ConversationState.LEGACY_PENDING.equals(conversation.getPrevState()); ApptentiveLog.d(CONVERSATION, "Conversation %s state changed %s -> %s.", conversationId, conversation.getPrevState(), conversation.getState());
public void logout() { checkConversationQueue(); if (activeConversation != null) { switch (activeConversation.getState()) { case LOGGED_IN: ApptentiveLog.d(CONVERSATION, "Ending active conversation."); EngagementModule.engageInternal(getContext(), activeConversation, "logout"); // Post synchronously to ensure logout payload can be sent before destroying the logged in conversation. 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."); } }
conversationMetadata.addItem(item); } else { assertTrue(conversation.getConversationId() != null || conversation.hasState(ANONYMOUS_PENDING) || conversation.hasState(LEGACY_PENDING), "Missing conversation id for state: %s", conversation.getState()); item.setConversationId(conversation.getConversationId()); item.setConversationState(conversation.getState()); if (conversation.hasActiveState()) { item.setConversationToken(notNull(conversation.getConversationToken()));