Background Fetch

Register background fetch in AppDelegate.m for CrystalExpress™ SDK to enable iOS waking up app in the background for fetch ad creatives.

How to Enable Background Fetch?

- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
    [I2WAPI triggerBackgroundFetchOnSuccess:^{
        completionHandler(UIBackgroundFetchResultNewData);
    } onFail:^{
        completionHandler(UIBackgroundFetchResultFailed);
    } onNoData:^{
        completionHandler(UIBackgroundFetchResultNoData);
    }];

    ......
}
configure background fetch
  1. Check "Background Fetch" in Target -> Capabilities -> Background Modes.

  2. Implement application:performFetchWithCompletionHandler: in AppDelegate.m:

Last updated