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 circumstancesMet callback will be called in the FactualEngineDelegate. In this callback, your app can trigger the appropriate messaging/content/app action for the circumstance.

...
@implementation AppDelegate

...

- (void)circumstancesMet:(NSArray<CircumstanceResponse *> *)circumstanceResponses{
  for (CircumstanceResponse *circumstanceResponse in circumstanceResponses) {
    NSString *circumstanceId = circumstanceResponse.circumstance.circumstanceId;
    NSArray<NSString *> *tags = circumstanceResponse.circumstance.tags;
    NSLog(@"Circumstance %@ with tags: %@ met.", circumstanceId, tags);
  }
}

@end