public JSONObject getProfile() { InteractionConfiguration configuration = getConfiguration(); if (configuration == null) { return null; } return configuration.optJSONObject(KEY_PROFILE); }
public boolean getWhoCardRequestEnabled() { InteractionConfiguration configuration = getConfiguration(); if (configuration == null) { return false; } JSONObject profile = configuration.optJSONObject(KEY_PROFILE); return profile.optBoolean(KEY_PROFILE_REQUEST, true); }
public boolean getWhoCardRequired() { InteractionConfiguration configuration = getConfiguration(); if (configuration == null) { return false; } JSONObject profile = configuration.optJSONObject(KEY_PROFILE); return profile.optBoolean(KEY_PROFILE_REQUIRE, false); }
public JSONObject getContextualMessage() { InteractionConfiguration configuration = getConfiguration(); if (configuration == null) { return null; } return configuration.optJSONObject(KEY_AUTOMATED_MESSAGE); }
public MessageCenterGreeting getGreeting() { InteractionConfiguration configuration = getConfiguration(); if (configuration == null) { return null; } JSONObject greeting = configuration.optJSONObject(KEY_GREETING); if (greeting == null) { return null; } return new MessageCenterGreeting(greeting.optString(KEY_GREETING_TITLE, null), greeting.optString(KEY_GREETING_BODY, null), greeting.optString(KEY_GREETING_IMAGE, null)); }
public Composer getComposer() { InteractionConfiguration configuration = getConfiguration(); if (configuration == null) { return null; } JSONObject composer = configuration.optJSONObject(KEY_COMPOSER); return new Composer( composer.optString(KEY_COMPOSER_TITLE, null), composer.optString(KEY_COMPOSER_CLOSE_BODY, null), composer.optString(KEY_COMPOSER_CLOSE_DISCARD, null), composer.optString(KEY_COMPOSER_CLOSE_CANCEL, null), composer.optString(KEY_COMPOSER_SEND_BUTTON, null), composer.optString(KEY_COMPOSER_HINT_TEXT, null) ); }
public MessageCenterStatus getErrorStatusNetwork() { InteractionConfiguration configuration = getConfiguration(); if (configuration == null) { return null; } JSONObject errorStatus = configuration.optJSONObject(KEY_ERROR); if (errorStatus == null) { return null; } return new MessageCenterStatus(errorStatus.optString(KEY_ERROR_NETWORK_BODY), R.drawable.apptentive_ic_no_connection); } }
public MessageCenterStatus getErrorStatusServer() { InteractionConfiguration configuration = getConfiguration(); if (configuration == null) { return null; } JSONObject errorStatus = configuration.optJSONObject(KEY_ERROR); if (errorStatus == null) { return null; } return new MessageCenterStatus(errorStatus.optString(KEY_ERROR_HTTP_BODY), R.drawable.apptentive_ic_error); }
public MessageCenterStatus getRegularStatus() { InteractionConfiguration configuration = getConfiguration(); if (configuration == null) { return null; } JSONObject status = configuration.optJSONObject(KEY_STATUS); if (status == null) { return null; } String statusBody = status.optString(KEY_STATUS_BODY); if (statusBody == null || statusBody.isEmpty()) { return null; } return new MessageCenterStatus(statusBody, null); }