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.

Config Instructions

Data collection can be disabled in the config.xml file until an explicit opt-in call occurs by setting this preference to true :

<preference name="com.urbanairship.data_collection_opt_in_enabled" value="true" />

By doing so, the SDK will require an explicit opt-in call to start collecting data.

Opting In: Data Collection

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


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:


Get Data Collection Status

If you want to check the current status for the Data Collection or the Push Token Registration, you can use the following calls: