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—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
| Privacy Manager Flag | Kotlin Constant | Features | AirshipConfig Value |
|---|---|---|---|
| Push | PrivacyManager.Feature.PUSH | Push notifications | push |
| In-App Automation | PrivacyManager.Feature.IN_APP_AUTOMATION | In-App Automation, In-App Messages, Scenes, and Landing Pages | in_app_automation |
| Message Center | PrivacyManager.Feature.MESSAGE_CENTER | Message Center | message_center |
| Tags and Attributes | PrivacyManager.Feature.TAGS_AND_ATTRIBUTES | Tags, Attributes, Subscription Lists, and Preference Center | tags_and_attributes |
| Contacts | PrivacyManager.Feature.CONTACTS | Contact Tags, Attributes, and Subscription Lists; Named User; and Associated Channels | contacts |
| Feature Flags | PrivacyManager.Feature.FEATURE_FLAGS | Feature flag evaluation and interaction | feature_flags |
| Analytics | PrivacyManager.Feature.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. interaction | analytics |
| On-Device AI | PrivacyManager.Feature.ON_DEVICE_AI | On-Device AI evaluations, including Embedded Content AI selection Android SDK 21+ | on_device_ai |
| All | PrivacyManager.Feature.ALL | All features | all |
| None | PrivacyManager.Feature.NONE | No features | none |
| Privacy Manager Flag | Java Constant | Features | AirshipConfig Value |
|---|---|---|---|
| Push | PrivacyManager.Feature.PUSH | Push notifications | push |
| In-App Automation | PrivacyManager.Feature.IN_APP_AUTOMATION | In-App Automation, In-App Messages, Scenes, and Landing Pages | in_app_automation |
| Message Center | PrivacyManager.Feature.MESSAGE_CENTER | Message Center | message_center |
| Tags and Attributes | PrivacyManager.Feature.TAGS_AND_ATTRIBUTES | Tags, Attributes, Subscription Lists, and Preference Center | tags_and_attributes |
| Contacts | PrivacyManager.Feature.CONTACTS | Contact Tags, Attributes, and Subscription Lists; Named User; and Associated Channels | contacts |
| Feature Flags | PrivacyManager.Feature.FEATURE_FLAGS | Feature flag evaluation and interaction | feature_flags |
| Analytics | PrivacyManager.Feature.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. interaction | analytics |
| On-Device AI | PrivacyManager.Feature.ON_DEVICE_AI | On-Device AI evaluations, including Embedded Content AI selection Android SDK 21+ | on_device_ai |
| All | PrivacyManager.Feature.ALL | All features | all |
| None | PrivacyManager.Feature.NONE | No features | none |
Configuring default enabled features
Default enabled features can be set in the Airship Config options passed to takeOff during SDK initialization. For information about setting up the Airship SDK and configuring AirshipConfigOptions, see Android SDK Setup.
Setting default features
airshipConfigOptions {
// ...
setEnabledFeatures(PrivacyManager.Feature.PUSH)
}enabledFeatures = pushAirshipConfigOptions.newBuilder()
// ...
.setEnabledFeatures(PrivacyManager.Feature.PUSH)
.build();enabledFeatures = pushTo fully disable data collection by default, set the enabled features to none.
Disabling all features
airshipConfigOptions {
// ...
setEnabledFeatures(PrivacyManager.Feature.NONE)
}enabledFeatures = noneAirshipConfigOptions.newBuilder()
// ...
.setEnabledFeatures(PrivacyManager.Feature.NONE)
.build();enabledFeatures = noneEnabling features at runtime
You can enable or disable features at runtime based on user consent:
Enabling features at runtime
// Initially disable all features
val options = airshipConfigOptions {
// ...
setEnabledFeatures(PrivacyManager.Feature.NONE)
}
// Later, when user grants consent:
Airship.privacyManager.enable(
PrivacyManager.Feature.PUSH,
PrivacyManager.Feature.ANALYTICS
)// Initially disable all features
AirshipConfigOptions options = AirshipConfigOptions.newBuilder()
// ...
.setEnabledFeatures(PrivacyManager.Feature.NONE)
.build();
// Later, when user grants consent:
Airship.getPrivacyManager().enable(
PrivacyManager.Feature.PUSH,
PrivacyManager.Feature.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.
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
val analyticsEnabled = Airship.privacyManager.isEnabled(PrivacyManager.Feature.ANALYTICS)
// Check if any of the given features are enabled
val eitherEnabled = Airship.privacyManager.isAnyEnabled(
PrivacyManager.Feature.PUSH,
PrivacyManager.Feature.ANALYTICS
)
// Listen for changes
scope.launch {
Airship.privacyManager.featureUpdates.collect { updatedFeatures ->
Log.d("Airship", "Enabled features changed: $updatedFeatures")
}
}// Check if a feature is enabled
boolean analyticsEnabled = Airship.getPrivacyManager().isEnabled(PrivacyManager.Feature.ANALYTICS);
// Check if any of the given features are enabled
boolean eitherEnabled = Airship.getPrivacyManager().isAnyEnabled(
PrivacyManager.Feature.PUSH,
PrivacyManager.Feature.ANALYTICS
);Listening for changes with featureUpdates is Kotlin only, since it’s a Flow.
Related documentation
- SDK Data Collection - Comprehensive overview of what data Airship collects for each Privacy Manager flag
- Google Play Data Safety - Reference for Google Play’s Data Safety section
- Analytics - Track user engagement with custom events, screen tracking, and associated identifiers