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 UAirship#dataCollectionEnabled to YES:

 Note

This flag will only take effect on first run.

Setting this flag can be done on the UAConfig instance at runtime before takeoff by setting UAConfig#dataCollectionOptInEnabled or by adding the dataCollectionOptInEnabled to your AirshipConfig.plist file and setting it to YES:

Example AirshipConfig.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  ...
  <key>dataCollectionOptInEnabled</key>
  <boolean>YES</boolean>
  ...
</dict>
</plist>

Opting In: Data Collection

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

  UAirship.shared()?.isDataCollectionEnabled = true
  [UAirship shared].dataCollectionEnabled = YES;

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:

  UAPush.shared().setPushTokenRegistrationEnabled(true)
  [[UAPush shared] setPushTokenRegistrationEnabled:YES];