Skip to main content

Offline mode

By default, the Adtrace SDK sends event and session data to Adtrace servers in real time. You can put the SDK in offline mode to suspend transmission to our servers while retaining tracked data to be sent later.

While in offline mode, all information is saved in a local file on the device. When you turn offline mode off, the SDK sends that data with the correct time information.

Important

The offline mode setting is not remembered between sessions. The SDK starts in online mode every time, even if the app was closed while offline.

Calls to setOfflineMode before appDidLaunch are ignored. Initialize the SDK first, then toggle offline mode.

Be careful not to trigger too many events while the SDK is offline.

Unlike disabling the SDK, offline mode only suspends network transmission. Tracking continues locally and is sent later with the correct time information.

Offline modeDisable SDK
Data recordingContinues locallyStops completely
Network sendsSuspendedSuspended
Persists between sessionsNo, starts online each launchYes, stays disabled until re-enabled
When re-enabledSends queued data with correct timestampsDoes not replay disabled period

Method signature

+ (void)setOfflineMode:(BOOL)enabled;
ParameterTypeDescription
enabledBOOLSet YES / true to enable offline mode. Set NO / false to return to online mode and send stored data.

Enable offline mode

Activate offline mode by calling setOfflineMode with YES / true on Adtrace.

[Adtrace setOfflineMode:YES];

Disable offline mode

Deactivate offline mode by calling setOfflineMode with NO / false. The SDK then sends all saved information to Adtrace servers with the correct time information.

[Adtrace setOfflineMode:NO];