Skip to main content

Background tracking

By default, the Adtrace SDK pauses sending network requests while your app is in the background. You can enable background tracking so the SDK continues to send requests when the app is not in the foreground.

Set this option on your ADTConfig instance before you call [Adtrace appDidLaunch:] / Adtrace.appDidLaunch(...). See Configuration for how to create the config.

Method signature

- (void)setSendInBackground:(BOOL)sendInBackground;

You can also assign the sendInBackground property directly on ADTConfig.

ParameterTypeDescription
sendInBackgroundBOOLSet YES / true to send requests while the app is in the background. Set NO / false to pause sending in the background (default).

Enable background tracking

Call setSendInBackground: on your ADTConfig instance.

Example

[adtraceConfig setSendInBackground:YES];

Or assign the property:

adtraceConfig.sendInBackground = YES;

If nothing is set, sending in the background is disabled by default.