Privacy Manager for the Apple SDK

Use Privacy Manager to enable or disable Airship SDK features for privacy and consent management.

Privacy Manager allows you to control which Airship SDK features are enabled. This is particularly useful for consent opt-in flows where you need to disable all features initially, then enable them as users grant consent. For information about what data is collected for each Privacy Manager flag, see SDK Data Collection.

When all features are disabled, the SDK operates in a no-op mode—it doesn’t store data or make network requests. Once features are enabled, you can enable or disable specific features at runtime based on user consent.

Privacy Manager flags

Each Privacy Manager flag controls a group of related Airship features. Enabling a flag enables all features within that group:

Privacy Manager flags

Swift ConstantFeaturesConfig Value
AirshipFeature.pushPush notificationspush
AirshipFeature.inAppAutomationIn-App Automation, In-App Messages, Scenes, and Landing Pagesin_app_automation
AirshipFeature.messageCenterMessage Centermessage_center
AirshipFeature.tagsAndAttributesTags, Attributes, Subscription Lists, and Preference Centertags_and_attributes
AirshipFeature.contactsContact Tags, Attributes, and Subscription Lists; Named User; and Associated Channelscontacts
AirshipFeature.analyticsAssociated identifiers, Custom events, Screen tracking, Surveys (questions and NPS surveys in ScenesA mobile app or web experience of one or more screens displayed with fully native UI components in real time, providing immediate, contextual responses to user behaviors. Scenes can be presented in full-screen, modal, or embedded format using the default swipe/click mode or as a Story. They can also contain survey questions.), email address (via form inputs in Scenes), Feature FlagAn experimentation tool for controlling the availability of content or functionality in your app or website. A flag’s Configurations determine the audience, schedule, and property values to apply when the flag is enabled. Flag properties enable making immediate code updates, bypassing the need for traditional code changes and release processes. interactionanalytics
AirshipFeature.featureFlagsFeature Flag evaluation and interactionfeature_flags
AirshipFeature.allAll featuresall
[]No featuresnone
Objective-C ConstantFeaturesConfig Value
UAFeatures.pushPush notificationspush
UAFeatures.inAppAutomationIn-App Automation, In-App Messages, Scenes, and Landing Pagesin_app_automation
UAFeatures.messageCenterMessage Centermessage_center
UAFeatures.tagsAndAttributesTags, Attributes, Subscription Lists, and Preference Centertags_and_attributes
UAFeatures.contactsContact Tags, Attributes, and Subscription Lists; Named User; and Associated Channelscontacts
UAFeatures.analyticsAssociated identifiers, Custom events, Screen tracking, Surveys (questions and NPS surveys in ScenesA mobile app or web experience of one or more screens displayed with fully native UI components in real time, providing immediate, contextual responses to user behaviors. Scenes can be presented in full-screen, modal, or embedded format using the default swipe/click mode or as a Story. They can also contain survey questions.), email address (via form inputs in Scenes), Feature FlagAn experimentation tool for controlling the availability of content or functionality in your app or website. A flag’s Configurations determine the audience, schedule, and property values to apply when the flag is enabled. Flag properties enable making immediate code updates, bypassing the need for traditional code changes and release processes. interactionanalytics
UAFeatures.featureFlagsFeature Flag evaluation and interactionfeature_flags
UAFeatures.allAll featuresall
UAFeatures.noneNo featuresnone

Configuring default enabled features

You can configure which features are enabled by default when the SDK initializes. This is done in your Airship config during takeOff.

Default configuration (all features enabled)

By default, all features are enabled. The SDK will collect data and make network requests as configured.

Disabling all features

To disable all features by default (useful for consent opt-in flows), set the enabled features to an empty array:

Disabling all features

Config
let config = AirshipConfig()
config.enabledFeatures = []

try! Airship.takeOff(config)
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>enabledFeatures</key>
  <array/>
  ...
</dict>
</plist>
UAConfig
UAConfig *config = [UAConfig config];
config.enabledFeatures = UAFeaturesNone;

[UAirship takeOff:config error:&airshipError];
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>enabledFeatures</key>
  <array/>
  ...
</dict>
</plist>

Enabling specific features

To enable only specific features by default:

Enabling specific features

Config
let config = AirshipConfig()
config.enabledFeatures = [.push, .analytics]

try! Airship.takeOff(config)
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>enabledFeatures</key>
  <array>
    <string>push</string>
    <string>analytics</string>
  </array>
  ...
</dict>
</plist>
UAConfig
UAConfig *config = [UAConfig config];
config.enabledFeatures = UAFeaturesPush | UAFeaturesAnalytics;

[UAirship takeOff:config error:&airshipError];
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>enabledFeatures</key>
  <array>
    <string>push</string>
    <string>analytics</string>
  </array>
  ...
</dict>
</plist>

Resetting features on each app start

If you need to gather consent on each app start, enable resetEnabledFeatures to reset enabled features to the config defaults on each takeOff, ignoring any previously persisted settings:

Resetting features on each start

var config = AirshipConfig()
config.enabledFeatures = []
config.resetEnabledFeatures = true

try! Airship.takeOff(config)
UAConfig *config = [UAConfig config];
config.enabledFeatures = UAFeaturesNone;
config.resetEnabledFeatures = YES;

[UAirship takeOff:config error:&airshipError];

Modifying enabled features at runtime

You can enable or disable features at any time after takeOff. Once you modify the enabled features from the default, those settings are persisted between app launches (unless resetEnabledFeatures is enabled in your config).

Enabling features

Enabling features

Airship.privacyManager.enableFeatures([.push, .analytics])
UAFeature *features = [[UAFeature alloc] initFrom:@[UAFeature.push, UAFeature.analytics]];
[UAirship.privacyManager enableFeatures:features];

Disabling features

Disabling features

Airship.privacyManager.disableFeatures([.push, .analytics])
UAFeature *features = [[UAFeature alloc] initFrom:@[UAFeature.push, UAFeature.analytics]];
[UAirship.privacyManager disableFeatures:features];

A common use case is to start with all features disabled, then enable them as users grant consent:

Consent opt-in example

// Start with all features disabled
var config = AirshipConfig()
config.enabledFeatures = []

try! Airship.takeOff(config)

// Later, when user grants consent:
func userGrantedConsent() {
    // Enable features based on user's consent choices
    Airship.privacyManager.enableFeatures([.push, .analytics])
}
// Start with all features disabled
UAConfig *config = [UAConfig config];
config.enabledFeatures = UAFeaturesNone;

[UAirship takeOff:config error:&airshipError];

// Later, when user grants consent:
- (void)userGrantedConsent {
    // Enable features based on user's consent choices
    UAFeature *features = [[UAFeature alloc] initFrom:@[UAFeature.push, UAFeature.analytics]];
    [UAirship.privacyManager enableFeatures:features];
}
 Note

If features are disabled after being previously enabled, the SDK may make a few network requests to opt the channel out to prevent notifications.