java.lang.Object | |
↳ | com.urbanairship.PrivacyManager |
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)
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Helper flag that is all features.
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
Enables contacts. In addition to the default data collection, contacts will collect: - External ids (named user)
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.
Enables Message Center (with MessageCenter module). In addition to the default data collection, Message Center will collect: - Message Center User - Message Reads & Deletes
Helper flag that can be used to set enabled features to none.
Enables push.
User notification still must be enabled using setUserNotificationsEnabled(boolean)
.
In addition to the default data collection, push will collect:
- Push tokens
Enables tags and attributes. In addition to the default data collection, tags and attributes will collect: - Channel and Contact Tags - Channel and Contact Attributes
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.
features | The features to disable. |
---|
Enables features, adding them to the set of currently enabled features. Any features that were previously enabled will remain enabled.
features | The features to enable. |
---|
Gets the current enabled features.
Checks if any of the given features are enabled.
features | The features to check. |
---|
true
if any of the provided features are enabled, otherwise false
.
Checks if any feature is enabled.
true
if any feature is enabled, otherwise false
.
Checks if all of the given features are enabled.
features | The features to check. |
---|
true
if all the provided features are enabled, otherwise false
.
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.
features | The features to set as enabled. |
---|