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, 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 FlagFeatures
pushPush notifications
in_app_automationIn-App Automation, In-App Messages, Scenes, and Landing Pages
message_centerMessage Center
tags_and_attributesTags, Attributes, Subscription Lists, and Preference Center
contactsContact Tags, Attributes, and Subscription Lists; Named User; and Associated Channels
analyticsAssociated identifiers, Custom events, Screen tracking, Surveys, email address, Feature Flag interaction
feature_flagsFeature Flag evaluation and interaction
allAll features
noneNo 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" });

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" });
}
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.