Use Circumstances

📘

Circumstances are combinations of filters allowing you to reach users in real time at relevant places and times. To learn more about what circumstances do and how to define them, follow this link.

When circumstances are met, the onCircumstancesMet callback will be called in the FactualClientReceiver. In this callback, your app can trigger the appropriate messaging/content/app action for the circumstance.

public class ConsoleLoggingFactualClientReceiver extends FactualClientReceiver {
  ...
  
  @Override
  public void onCircumstancesMet(List<CircumstanceResponse> responses) {
    for (CircumstanceResponse response : responses) {
      List<String> tags = response.getCircumstance().getTags();
      String circumstanceId = response.getCircumstance().getCircumstanceId();
      String message = "Circumstance " + circumstanceId + " with tags: " + tags + " met.";
      Log.i("engine", message);
    }
  }
}