Privacy Manager for the React Native Module

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 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. This is done in your Airship config during takeOff. For information about setting up the Airship SDK and configuring the takeOff options, see React Native SDK Setup.

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:

await Airship.takeOff({
    default: {
        enabledFeatures: []
    },
    ...
});

Enabling specific features

To enable only specific features by default:

await Airship.takeOff({
    default: {
        enabledFeatures: ["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

await Airship.privacyManager.enableFeatures(["push", "analytics"]);

Disabling features

await Airship.privacyManager.disableFeatures(["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
await Airship.takeOff({
    default: {
        enabledFeatures: []
    },
    ...
});

// Later, when user grants consent:
async function userGrantedConsent() {
    // Enable features based on user's consent choices
    await Airship.privacyManager.enableFeatures(["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.