public class

PrivacyManager

extends Object
java.lang.Object
   ↳ com.urbanairship.PrivacyManager

Class Overview

The privacy manager allow enabling/disabling features in the SDK that require user data. The SDK will not make any network requests or collect data if all features our disabled, with a few exceptions when going from enabled -> disabled. To have the SDK opt-out of all features on startup, set the default enabled features in the AirshipConfig to FEATURE_NONE, or in the airshipconfig.properties file with `enabledFeatures = none`. Some features might offer additional opt-in settings directly on the module. For instance, enabling FEATURE_PUSH will only enable push message delivery, however you still need to opt-in to setUserNotificationsEnabled(boolean) before notifications will be allowed. If any feature is enabled, the SDK will collect and send the following data: - Channel ID - Locale - TimeZone - Platform - Opt in state (push and notifications) - SDK version - Push provider (HMS, FCM, ADM) - Manufacturer (if Huawei) - Accengage Device ID (when using the Accengage module for migration)

Summary

Nested Classes
@interface PrivacyManager.Feature  
Constants
int FEATURE_ALL Helper flag that is all features.
int FEATURE_ANALYTICS Enables analytics.
int FEATURE_CONTACTS Enables contacts.
int FEATURE_IN_APP_AUTOMATION Enables In-App Automation (with Automation module).
int FEATURE_MESSAGE_CENTER Enables Message Center (with MessageCenter module).
int FEATURE_NONE Helper flag that can be used to set enabled features to none.
int FEATURE_PUSH Enables push.
int FEATURE_TAGS_AND_ATTRIBUTES Enables tags and attributes.
Public Constructors
PrivacyManager(PreferenceDataStore dataStore, int defaultEnabledFeatures)
Public Methods
void disable(int... features)
Disables features, removing them from the set of currently enabled features.
void enable(int... features)
Enables features, adding them to the set of currently enabled features.
int getEnabledFeatures()
Gets the current enabled features.
boolean isAnyEnabled(int... features)
Checks if any of the given features are enabled.
boolean isAnyFeatureEnabled()
Checks if any feature is enabled.
boolean isEnabled(int... features)
Checks if all of the given features are enabled.
void setEnabledFeatures(int... features)
Sets the current enabled features, replacing any currently enabled features with the given set.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int FEATURE_ALL

Helper flag that is all features.

Constant Value: 119 (0x00000077)

public static final int FEATURE_ANALYTICS

Enables analytics. In addition to the default data collection, analytics will collect: - Events - Associated Identifiers - Registered Notification Types - Time in app - App Version - Device model - Device manufacturer - OS version - Carrier - Connection type - Framework usage

Constant Value: 16 (0x00000010)

public static final int FEATURE_CONTACTS

Enables contacts. In addition to the default data collection, contacts will collect: - External ids (named user)

Constant Value: 64 (0x00000040)

public static final int FEATURE_IN_APP_AUTOMATION

Enables In-App Automation (with Automation module). In addition to the default data collection, In-App Automation will collect: - App Version (App update triggers) FEATURE_ANALYTICS is required for event and screen view triggers.

Constant Value: 1 (0x00000001)

public static final int FEATURE_MESSAGE_CENTER

Enables Message Center (with MessageCenter module). In addition to the default data collection, Message Center will collect: - Message Center User - Message Reads & Deletes

Constant Value: 2 (0x00000002)

public static final int FEATURE_NONE

Helper flag that can be used to set enabled features to none.

Constant Value: 0 (0x00000000)

public static final int FEATURE_PUSH

Enables push. User notification still must be enabled using setUserNotificationsEnabled(boolean). In addition to the default data collection, push will collect: - Push tokens

Constant Value: 4 (0x00000004)

public static final int FEATURE_TAGS_AND_ATTRIBUTES

Enables tags and attributes. In addition to the default data collection, tags and attributes will collect: - Channel and Contact Tags - Channel and Contact Attributes

Constant Value: 32 (0x00000020)

Public Constructors

public PrivacyManager (PreferenceDataStore dataStore, int defaultEnabledFeatures)

Public Methods

public void disable (int... features)

Disables features, removing them from the set of currently enabled features. Any features that were previously enabled and not passed to disable will remain enabled.

Parameters
features The features to disable.

public void enable (int... features)

Enables features, adding them to the set of currently enabled features. Any features that were previously enabled will remain enabled.

Parameters
features The features to enable.

public int getEnabledFeatures ()

Gets the current enabled features.

Returns
  • The enabled features.

public boolean isAnyEnabled (int... features)

Checks if any of the given features are enabled.

Parameters
features The features to check.
Returns
  • true if any of the provided features are enabled, otherwise false.

public boolean isAnyFeatureEnabled ()

Checks if any feature is enabled.

Returns
  • true if any feature is enabled, otherwise false.

public boolean isEnabled (int... features)

Checks if all of the given features are enabled.

Parameters
features The features to check.
Returns
  • true if all the provided features are enabled, otherwise false.

public void setEnabledFeatures (int... features)

Sets the current enabled features, replacing any currently enabled features with the given set. Any features that were previously enabled and not passed into the current set will be disabled.

Parameters
features The features to set as enabled.