public static Configuration load() { if (cachedConfiguration == null) { SharedPreferences prefs = ApptentiveInternal.getInstance().getGlobalSharedPrefs(); cachedConfiguration = Configuration.load(prefs); } return cachedConfiguration; }
public String getBody(Context context) { InteractionConfiguration configuration = getConfiguration(); if (configuration != null && !configuration.isNull(KEY_BODY)) { return configuration.optString(KEY_BODY, null); } return String.format(context.getResources().getString(R.string.apptentive_rating_message_fs), Configuration.load().getAppDisplayName()); }
public String getRateText(Context context) { InteractionConfiguration configuration = getConfiguration(); if (configuration != null && !configuration.isNull(KEY_RATE_TEXT)) { return configuration.optString(KEY_RATE_TEXT, null); } return String.format(context.getResources().getString(R.string.apptentive_rate_this_app), Configuration.load().getAppDisplayName()); }
MessagePollingWorker(MessageManager messageManager) { if (messageManager == null) { throw new IllegalArgumentException("Message manager is null"); } this.messageManager = messageManager; conf = Configuration.load(); backgroundPollingInterval = conf.getMessageCenterBgPoll() * 1000; foregroundPollingInterval = conf.getMessageCenterFgPoll() * 1000; ApptentiveLog.v(MESSAGES, "Message Polling Worker: bg=%d, fg=%d", backgroundPollingInterval, foregroundPollingInterval); }
/** * We want to make sure the app is using the latest configuration from the server if the app or sdk version changes. */ private void invalidateCaches(Conversation conversation) { checkConversationQueue(); conversation.setInteractionExpiration(0L); Configuration config = Configuration.load(); config.setConfigurationCacheExpirationMillis(System.currentTimeMillis()); config.save(); }
public String getTitle() { InteractionConfiguration configuration = getConfiguration(); if (configuration != null && !configuration.isNull(KEY_TITLE)) { return configuration.optString(KEY_TITLE, null); } return ApptentiveInternal.getInstance().getApplicationContext().getResources(). getString(R.string.apptentive_do_you_love_this_app, Configuration.load().getAppDisplayName()); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.apptentive_upgrade_message_interaction, container, false); try { ImageView iconView = (ImageView) v.findViewById(R.id.icon); Drawable icon = getIconDrawableResourceId(); if (icon != null) { iconView.setImageDrawable(icon); } else { iconView.setVisibility(View.GONE); } WebView webview = (WebView) v.findViewById(R.id.webview); webview.loadData(interaction.getBody(), "text/html", "UTF-8"); webview.setBackgroundColor(Color.TRANSPARENT); // Hack to keep webview background from being colored after load. // If branding is not desired, turn the view off. final View branding = v.findViewById(R.id.apptentive_branding_view); if (branding != null) { if (!interaction.isShowPoweredBy() || Configuration.load().isHideBranding(getContext())) { branding.setVisibility(View.GONE); } } } catch (Exception e) { ApptentiveLog.e(e, "Exception in %s.onCreateView()", UpgradeMessageFragment.class.getSimpleName()); logException(e); } return v; }
data.put("extraData", extraData); Configuration config = Configuration.load(); if (config.isMetricsEnabled()) { ApptentiveLog.v(UTIL, "Sending Error Metric: %s, data: %s", type.getLabelName(), data.toString());
errorMessage = ratingProvider.activityNotFoundMessage(activity); String appDisplayName = Configuration.load().getAppDisplayName(); Map<String, String> ratingProviderArgs = ApptentiveInternal.getInstance().getRatingProviderArgs(); Map<String, String> finalRatingProviderArgs;
public static void sendMetric(final EventPayload.EventLabel type, final String trigger, final Map<String, String> data) { if (!isConversationQueue()) { dispatchOnConversationQueue(new DispatchTask() { @Override protected void execute() { sendMetric(type, trigger, data); } }); return; } Configuration config = Configuration.load(); if (config.isMetricsEnabled()) { ApptentiveLog.v(UTIL, "Sending Metric: %s, trigger: %s, data: %s", type.getLabelName(), trigger, data != null ? data.toString() : "null"); EventPayload event = new EventPayload(type.getLabelName(), trigger); event.putData(data); sendEvent(event); } }
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); } }
Configuration configuration = Configuration.load(); if (configuration.isCollectingAdID()) { AdvertiserManager.AdvertisingIdClientInfo info = AdvertiserManager.getAdvertisingIdClientInfo();
void tryUpdateApptimizeData() { checkConversationQueue(); Configuration configuration = Configuration.load(); if (!configuration.isCollectingApptimizeData()) { return;
if (!Configuration.load().hasConfigurationCacheExpired()) {
onAppEnterForeground(); if (Configuration.load().isCollectingAdID()) {