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_CHAT Enables Airship Chat (with AirshipChat module).
int FEATURE_CONTACTS Enables contacts.
int FEATURE_IN_APP_AUTOMATION Enables In-App Automation (with Automation module).
int FEATURE_LOCATION Enables location (with Location 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)
Enables features.
void enable(int... features)
Enables features.
int getEnabledFeatures()
Gets the current enabled features.
boolean isAnyEnabled(int... features)
boolean isAnyFeatureEnabled()
Checks if any feature is enabled.
boolean isEnabled(int... features)
Checks if a given feature is enabled.
void setEnabledFeatures(int... features)
Sets the current enabled features.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int FEATURE_ALL

Helper flag that is all features.

Constant Value: 255 (0x000000ff)

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_CHAT

Enables Airship Chat (with AirshipChat module). In addition to the default data collection, Airship Chat will collect: - User messages

Constant Value: 8 (0x00000008)

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_LOCATION

Enables location (with Location module). Enabling location still requires requesting permissions, and either requesting a single location or enabling continuous location updates. In addition to the default data collection, location will collect: - Location permissions - Collect location for the app (Airship no longer supports uploading location as events)

Constant Value: 128 (0x00000080)

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)

Enables features.

Parameters
features The features to enable.

public void enable (int... features)

Enables features.

Parameters
features The features to enable.

public int getEnabledFeatures ()

Gets the current enabled features.

Returns
  • The enabled features.

public boolean isAnyEnabled (int... features)

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 a given feature is enabled.

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

public void setEnabledFeatures (int... features)

Sets the current enabled features.

Parameters
features The features to set as enabled.