public synchronized Person getPerson() { return conversation.getPerson(); // TODO: make conversation immutable }
@Override protected void execute() { conversation.getPerson().setEmail(personEmail); } });
@Override protected void execute() { conversation.getPerson().setName(personName); } });
@Override protected boolean execute(Conversation conversation) { conversation.getPerson().getCustomData().put(key, value); return true; } }, "add custom person data");
@Override protected boolean execute(Conversation conversation) { conversation.getPerson().getCustomData().put(key, value); return true; } }, "add custom person data");
@Override protected boolean execute(Conversation conversation) { conversation.getPerson().getCustomData().put(key, version); return true; } }, "add custom person data");
@Override protected boolean execute(Conversation conversation) { conversation.getPerson().getCustomData().put(key, dateTime); return true; } }, "add custom person data");
@Override protected boolean execute(Conversation conversation) { conversation.getPerson().getCustomData().remove(key); return true; } }, "remove custom person data");
@Override protected boolean execute(Conversation conversation) { conversation.getPerson().getCustomData().put(key, trim(value)); return true; } }, "add custom person data");
private synchronized void synchronize() { personEmail = conversation.getPerson().getEmail(); personName = conversation.getPerson().getName(); messageCenterPendingMessage = conversation.getMessageCenterPendingMessage(); messageCenterPendingAttachments = conversation.getMessageCenterPendingAttachments(); hasActiveState = conversation.hasActiveState(); messageCenterWhoCardPreviouslyDisplayed = conversation.isMessageCenterWhoCardPreviouslyDisplayed(); unreadMessageCount = conversation.getMessageManager().getUnreadMessageCount(); }
@Override protected boolean execute(Conversation conversation) { CompoundMessage message = new CompoundMessage(); message.setBody(text); message.setRead(true); message.setHidden(true); message.setSenderId(conversation.getPerson().getId()); message.setAssociatedFiles(null); conversation.getMessageManager().sendMessage(message); return true; } }, "send attachment text");
message.setRead(true); message.setHidden(true); message.setSenderId(conversation.getPerson().getId());
FieldManager fieldManager = new FieldManager(context, conversation.getVersionHistory(), conversation.getEventData(), conversation.getPerson(), conversation.getDevice(), conversation.getAppRelease()); if (invocation.isCriteriaMet(fieldManager, true)) { interactionIdToLaunch = invocation.getInteractionId();
public String getApplicableInteraction(String eventLabel, boolean verbose) { JSONArray invocations = optJSONArray(eventLabel); if (invocations != null) { for (int i = 0; i < invocations.length(); i++) { JSONObject invocationObject = invocations.optJSONObject(i); if (invocationObject != null) { try { Invocation invocation = new Invocation(invocationObject.toString()); Conversation conversation = ApptentiveInternal.getInstance().getConversation(); FieldManager fieldManager = new FieldManager(ApptentiveInternal.getInstance().getApplicationContext(), conversation.getVersionHistory(), conversation.getEventData(), conversation.getPerson(), conversation.getDevice(), conversation.getAppRelease()); if (invocation.isCriteriaMet(fieldManager, verbose)) { return invocation.getInteractionId(); } } catch (JSONException e) { logException(e); } } } } ApptentiveLog.v(INTERACTIONS, "No runnable Interactions for EventLabel: %s", eventLabel); return null; } }
@Override protected boolean execute(Conversation conversation) { if (is == null) { return false; // TODO: add error message } CompoundMessage message = new CompoundMessage(); // No body, just attachment message.setBody(null); message.setRead(true); message.setHidden(true); message.setSenderId(conversation.getPerson().getId()); ArrayList<StoredFile> attachmentStoredFiles = new ArrayList<StoredFile>(); String localFilePath = Util.generateCacheFilePathFromNonceOrPrefix(ApptentiveInternal.getInstance().getApplicationContext(), message.getNonce(), null); String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType); if (!TextUtils.isEmpty(extension)) { localFilePath += "." + extension; } // When created from InputStream, there is no source file uri or path, thus just use the cache file path StoredFile storedFile = Util.createLocalStoredFile(is, localFilePath, localFilePath, mimeType); if (storedFile == null) { return false; // TODO: add error message } storedFile.setId(message.getNonce()); attachmentStoredFiles.add(storedFile); message.setAssociatedFiles(attachmentStoredFiles); conversation.getMessageManager().sendMessage(message); return true; } }, "add unread message listener");