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 Constant | Features | Config Value |
|---|---|---|
AirshipFeature.push | Push notifications | push |
AirshipFeature.inAppAutomation | In-App Automation, In-App Messages, Scenes, and Landing Pages | in_app_automation |
AirshipFeature.messageCenter | Message Center | message_center |
AirshipFeature.tagsAndAttributes | Tags, Attributes, Subscription Lists, and Preference Center | tags_and_attributes |
AirshipFeature.contacts | Contact Tags, Attributes, and Subscription Lists; Named User; and Associated Channels | contacts |
AirshipFeature.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. 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. interaction | analytics |
AirshipFeature.featureFlags | Feature Flag evaluation and interaction | feature_flags |
AirshipFeature.all | All features | all |
[] | No features | none |
| Objective-C Constant | Features | Config Value |
|---|---|---|
UAFeatures.push | Push notifications | push |
UAFeatures.inAppAutomation | In-App Automation, In-App Messages, Scenes, and Landing Pages | in_app_automation |
UAFeatures.messageCenter | Message Center | message_center |
UAFeatures.tagsAndAttributes | Tags, Attributes, Subscription Lists, and Preference Center | tags_and_attributes |
UAFeatures.contacts | Contact Tags, Attributes, and Subscription Lists; Named User; and Associated Channels | contacts |
UAFeatures.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. 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. interaction | analytics |
UAFeatures.featureFlags | Feature Flag evaluation and interaction | feature_flags |
UAFeatures.all | All features | all |
UAFeatures.none | No features | none |
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
let config = AirshipConfig()
config.enabledFeatures = []
try! Airship.takeOff(config)<?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 *config = [UAConfig config];
config.enabledFeatures = UAFeaturesNone;
[UAirship takeOff:config error:&airshipError];<?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
let config = AirshipConfig()
config.enabledFeatures = [.push, .analytics]
try! Airship.takeOff(config)<?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 *config = [UAConfig config];
config.enabledFeatures = UAFeaturesPush | UAFeaturesAnalytics;
[UAirship takeOff:config error:&airshipError];<?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];Consent opt-in flow example
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];
}If features are disabled after being previously enabled, the SDK may make a few network requests to opt the channel out to prevent notifications.
Related documentation
- SDK Data Collection - Comprehensive overview of what data Airship collects for each Privacy Manager flag
- Apple Privacy Manifest - Declare data collection practices to Apple
- Analytics - Track user engagement with custom events, screen tracking, and associated identifiers
- Permission Gathering - Request additional permissions from users
Categories