Privacy Manager

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

View as Markdown

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. Scene content can also be displayed in a Message Center message and 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.onDeviceAIOn-Device AI evaluations, including Embedded Content AI selection iOS SDK 21+on_device_ai
AirshipFeature.allAll featuresall
[]No featuresnone
Objective-C MethodFeaturesConfig Value
[UAFeature push]Push notificationspush
[UAFeature inAppAutomation]In-App Automation, In-App Messages, Scenes, and Landing Pagesin_app_automation
[UAFeature messageCenter]Message Centermessage_center
[UAFeature tagsAndAttributes]Tags, Attributes, Subscription Lists, and Preference Centertags_and_attributes
[UAFeature contacts]Contact Tags, Attributes, and Subscription Lists; Named User; and Associated Channelscontacts
[UAFeature analytics]Associated 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. Scene content can also be displayed in a Message Center message and 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
[UAFeature featureFlags]Feature flag evaluation and interactionfeature_flags
[UAFeature onDeviceAI]On-Device AI evaluations, including Embedded Content AI selection iOS SDK 21+on_device_ai
[UAFeature all]All featuresall
[UAFeature none]No 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
@import AirshipObjectiveC;

UAConfig *config = [UAConfig config];
config.enabledFeatures = [UAFeature none];

[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
@import AirshipObjectiveC;

UAConfig *config = [UAConfig config];
config.enabledFeatures = [[UAFeature alloc] initFrom:@[[UAFeature push], [UAFeature analytics]]];

[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)
@import AirshipObjectiveC;

UAConfig *config = [UAConfig config];
config.enabledFeatures = [UAFeature none];
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])
@import AirshipObjectiveC;

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

Disabling features

Disabling features

Airship.privacyManager.disableFeatures([.push, .analytics])
@import AirshipObjectiveC;

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

Checking enabled features

Check which features are currently enabled, or listen for changes driven by your own code or by remote config:

Checking enabled features

// Check if a feature is enabled
let analyticsEnabled = Airship.privacyManager.isEnabled(.analytics)

// Check if any feature is enabled
let anyEnabled = Airship.privacyManager.isAnyFeatureEnabled()

// Listen for changes
Task {
    for await enabledFeatures in Airship.privacyManager.updates {
        print("Enabled features changed: \(enabledFeatures)")
    }
}
@import AirshipObjectiveC;

// Check if a feature is enabled
BOOL analyticsEnabled = [UAirship.privacyManager isEnabled:[UAFeature analytics]];

// Check if any feature is enabled
BOOL anyEnabled = [UAirship.privacyManager isAnyFeatureEnabled];
Note

Listening for changes with updates is Swift only, since it’s an AsyncStream.

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])
}
@import AirshipObjectiveC;

// Start with all features disabled
UAConfig *config = [UAConfig config];
config.enabledFeatures = [UAFeature none];

[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.