Data Collection

Data collection can be disabled at the SDK level to prevent the collection of any data other than essential, de-identified data from occurring. Disabling data collection disables the following Airship features:

  • Push tokens
  • Channels
  • Analytics events
  • Location
  • Attributes
  • Associated Identifiers
  • Tags
  • Named user

Remaining functionality (when data collection is disabled) includes broadcast Message center messages and broadcast In-App Automation messages. When data collection is disabled, Airship will still collect language, language country, timezone, app version, SDK version, and device OS.

Data collection can be disabled at the SDK level until an explicit opt-in call occurs by setting AirshipConfigOptions.dataCollectionOptInEnabled to true:

 Note

This flag will only take effect on first run.

Setting this flag can be accomplished by extending AirshipConfigOptions or by adding the dataCollectionOptInEnabled property to your airshipconfig.properties file and setting it to true:

Example: airshipconfig.properties
  # Require explicit opt-in to data collection
  dataCollectionOptInEnabled = true

Opting In: Data Collection

Restoring full Airship functionality by opting back into data collection can be accomplished with the following call:

UAirship.shared().setDataCollectionEnabled(true);
UAirship.shared().isDataCollectionEnabled = true

Excluding Push from Opt-out

By default, push functionality will also be disabled when data collection is disabled. However, you can override this behavior with the following call:

UAirship.shared().getPushManager().setPushTokenRegistrationEnabled(true);
UAirship.shared().pushManager.isPushTokenRegistrationEnabled = true