public synchronized Device getDevice() { return conversation.getDevice(); // TODO: make conversation immutable }
@Override protected boolean execute(Conversation conversation) { conversation.getDevice().getCustomData().put(key, dateTime); return true; } }, "add custom device data");
@Override protected boolean execute(Conversation conversation) { conversation.getDevice().getCustomData().put(key, value); return true; } }, "add custom device data");
@Override protected boolean execute(Conversation conversation) { conversation.getDevice().getCustomData().put(key, version); return true; } }, "add custom device data");
@Override protected boolean execute(Conversation conversation) { conversation.getDevice().getCustomData().put(key, value); return true; } }, "add custom device data");
@Override protected boolean execute(Conversation conversation) { conversation.getDevice().getCustomData().remove(key); return true; } }, "remove custom device data");
@Override protected boolean execute(Conversation conversation) { conversation.getDevice().getCustomData().put(key, trim(value)); return true; } }, "add custom device data");
private void updateConversationAdvertiserIdentifier(Conversation conversation) { checkConversationQueue(); try { Configuration config = Configuration.load(); if (config.isCollectingAdID()) { AdvertisingIdClientInfo info = AdvertiserManager.getAdvertisingIdClientInfo(); String advertiserId = info != null && !info.isLimitAdTrackingEnabled() ? info.getId() : null; conversation.getDevice().setAdvertiserId(advertiserId); } } catch (Exception e) { ApptentiveLog.e(ADVERTISER_ID, e, "Exception while updating conversation advertiser id"); logException(e); } }
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; } }
public void setPushIntegration(int pushProvider, String token) { ApptentiveLog.v(CONVERSATION, "Setting push provider: %d with token %s", pushProvider, token); IntegrationConfig integrationConfig = getDevice().getIntegrationConfig(); IntegrationConfigItem item = new IntegrationConfigItem(); item.setToken(token); switch (pushProvider) { case Apptentive.PUSH_PROVIDER_APPTENTIVE: integrationConfig.setApptentive(item); break; case Apptentive.PUSH_PROVIDER_PARSE: integrationConfig.setParse(item); break; case Apptentive.PUSH_PROVIDER_URBAN_AIRSHIP: integrationConfig.setUrbanAirship(item); break; case Apptentive.PUSH_PROVIDER_AMAZON_AWS_SNS: integrationConfig.setAmazonAwsSns(item); break; default: ApptentiveLog.e(CONVERSATION, "Invalid pushProvider: %d", pushProvider); break; } }
conversation.getDevice().getCustomData().put(key, variantName);