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 AdTraceConfig instance before you call AdTrace.onCreate(). See Configuration for how to create the config.
Method signature
public void setSendInBackground(boolean sendInBackground)
| Parameter | Type | Description |
|---|---|---|
sendInBackground | boolean | Set true to send requests while the app is in the background. Set false to pause sending in the background (default). |
Enable background tracking
Call setSendInBackground(true) on your AdTraceConfig instance.
Example
- Java
- Kotlin
- Javascript
config.setSendInBackground(true);
config.setSendInBackground(true)
config.setSendInBackground(true);