# 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](https://www.airship.com/docs/reference/data-collection/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:


#### Swift



| 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](https://www.airship.com/docs/guides/audience/tags/), [Attributes](https://www.airship.com/docs/guides/audience/attributes/about/), 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 [Scenes](https://www.airship.com/docs/reference/glossary/#scene)), email address (via form inputs in Scenes), [Feature Flag](https://www.airship.com/docs/reference/glossary/#feature_flag) interaction | `analytics` |
| `AirshipFeature.featureFlags` | Feature Flag evaluation and interaction | `feature_flags` |
| `AirshipFeature.all` | All features | `all` |
| `[]` | No features | `none` |



#### Objective-C



| 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](https://www.airship.com/docs/guides/audience/tags/), [Attributes](https://www.airship.com/docs/guides/audience/attributes/about/), 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 [Scenes](https://www.airship.com/docs/reference/glossary/#scene)), email address (via form inputs in Scenes), [Feature Flag](https://www.airship.com/docs/reference/glossary/#feature_flag) 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](https://www.airship.com/docs/developer/sdk-integration/apple/installation/getting-started/#calling-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:


#### Swift



**Config**

```swift
let config = AirshipConfig()
config.enabledFeatures = []

try! Airship.takeOff(config)
```


**AirshipConfig.plist**

```xml
<?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>
```



#### Objective-C



**UAConfig**

```objc
UAConfig *config = [UAConfig config];
config.enabledFeatures = UAFeaturesNone;

[UAirship takeOff:config error:&airshipError];
```


**AirshipConfig.plist**

```xml
<?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:


#### Swift



**Config**

```swift
let config = AirshipConfig()
config.enabledFeatures = [.push, .analytics]

try! Airship.takeOff(config)
```


**AirshipConfig.plist**

```xml
<?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>
```



#### Objective-C



**UAConfig**

```objc
UAConfig *config = [UAConfig config];
config.enabledFeatures = UAFeaturesPush | UAFeaturesAnalytics;

[UAirship takeOff:config error:&airshipError];
```


**AirshipConfig.plist**

```xml
<?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:


#### Swift


```swift
var config = AirshipConfig()
config.enabledFeatures = []
config.resetEnabledFeatures = true

try! Airship.takeOff(config)
```



#### Objective-C


```objc
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


#### Swift


```swift
Airship.privacyManager.enableFeatures([.push, .analytics])
```



#### Objective-C


```objc
UAFeature *features = [[UAFeature alloc] initFrom:@[UAFeature.push, UAFeature.analytics]];
[UAirship.privacyManager enableFeatures:features];
```




### Disabling features


#### Swift


```swift
Airship.privacyManager.disableFeatures([.push, .analytics])
```



#### Objective-C


```objc
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:


#### Swift


```swift
// 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])
}
```



#### Objective-C


```objc
// 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];
}
```




> **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.


## Related documentation

- [SDK Data Collection](https://www.airship.com/docs/reference/data-collection/sdk-data-collection/) - Comprehensive overview of what data Airship collects for each Privacy Manager flag
- [Apple Privacy Manifest](https://www.airship.com/docs/reference/data-collection/apple-privacy-manifest/) - Declare data collection practices to Apple
- [Analytics](https://www.airship.com/docs/developer/sdk-integration/apple/analytics/) - Track user engagement with custom events, screen tracking, and associated identifiers
- [Permission Gathering](https://www.airship.com/docs/developer/sdk-integration/apple/data-collection/permission-gathering/) - Request additional permissions from users

