All Downloads are FREE. Search and download functionalities are using the official Maven repository.

co.easimart.EasimartAnalyticsController Maven / Gradle / Ivy

package co.easimart;

import org.json.JSONObject;

import bolts.Task;

/** package */ class EasimartAnalyticsController {

  /* package for test */ EasimartEventuallyQueue eventuallyQueue;

  public EasimartAnalyticsController(EasimartEventuallyQueue eventuallyQueue) {
    this.eventuallyQueue = eventuallyQueue;
  }

  public Task trackEventInBackground(final String name,
    JSONObject jsonDimensions, String sessionToken) {
    EasimartRESTCommand command = EasimartRESTAnalyticsCommand.trackEventCommand(name, jsonDimensions,
            sessionToken);

    Task eventuallyTask = eventuallyQueue.enqueueEventuallyAsync(command, null);
    return eventuallyTask.makeVoid();
  }

  public Task trackAppOpenedInBackground(String pushHash, String sessionToken) {
    EasimartRESTCommand command = EasimartRESTAnalyticsCommand.trackAppOpenedCommand(pushHash,
            sessionToken);

    Task eventuallyTask = eventuallyQueue.enqueueEventuallyAsync(command, null);
    return eventuallyTask.makeVoid();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy