Privacy Manager
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, so it does not 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 Flag | Features |
|---|---|
push | Push notifications |
in_app_automation | In-App Automation, In-App Messages, Scenes, and Landing Pages |
message_center | Message Center |
tags_and_attributes | Tags, Attributes, Subscription Lists, and Preference Center |
contacts | Contact Tags, Attributes, and Subscription Lists; Named User; and Associated Channels |
analytics | Associated identifiers, Custom events, Screen tracking, Surveys, email address, Feature Flag interaction |
feature_flags | Feature Flag evaluation and interaction |
all | All features |
none | No features |
Configuring default enabled features
You can configure which features are enabled by default when the SDK initializes. Set enabledFeatures in your Airship config when calling TakeOff. For information about setting up the Airship SDK, see Install and Set Up the Unity Plugin.
Default configuration (all features enabled)
By default, all features are enabled. The SDK collects data and makes network requests as configured.
Disabling all features
To disable all features by default, which is useful for consent opt-in flows, set enabledFeatures to an empty array:
using AirshipSDK;
Airship.Shared.TakeOff(new AirshipConfig() {
@default = new ConfigEnvironment() {
appKey = "<APP_KEY>",
appSecret = "<APP_SECRET>",
},
enabledFeatures = new string[] { },
});Enabling specific features
To enable only specific features by default:
using AirshipSDK;
Airship.Shared.TakeOff(new AirshipConfig() {
@default = new ConfigEnvironment() {
appKey = "<APP_KEY>",
appSecret = "<APP_SECRET>",
},
enabledFeatures = new string[] { "push", "analytics" },
});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.
Enabling features
Airship.Shared.privacyManager.EnableFeatures(new string[] { "push", "analytics" });Disabling features
Airship.Shared.privacyManager.DisableFeatures(new string[] { "push", "analytics" });Consent opt-in flow example
A common use case is to start with all features disabled, then enable them as users grant consent:
// Start with all features disabled
Airship.Shared.TakeOff(new AirshipConfig() {
@default = new ConfigEnvironment() {
appKey = "<APP_KEY>",
appSecret = "<APP_SECRET>",
},
enabledFeatures = new string[] { },
});
// Later, when the user grants consent:
void UserGrantedConsent() {
// Enable features based on the user's consent choices
Airship.Shared.privacyManager.EnableFeatures(new string[] { "push", "analytics" });
}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 (iOS)
- Google Play Data Safety - Reference for Google Play’s Data Safety section (Android)
- Analytics - Track user engagement with custom events, screen tracking, and associated identifiers