PrivacyManager

class PrivacyManager @RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP]) @JvmOverloads constructor(    dataStore: PreferenceDataStore,     defaultEnabledFeatures: PrivacyManager.Feature,     configObserver: RemoteConfigObserver = RemoteConfigObserver(dataStore),     resetEnabledFeatures: Boolean = false)

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 com.urbanairship.push.PushManager.setUserNotificationsEnabled before notifications will be allowed.

If any feature is enabled, the SDK will collect and send the following data:

  • Channel ID

  • Contact ID

  • Locale

  • TimeZone

  • Platform

  • Opt in state (push and notifications)

  • SDK version

  • Push provider (HMS, FCM, ADM)

  • Manufacturer (if Huawei)

Constructors

Link copied to clipboard
constructor(    dataStore: PreferenceDataStore,     defaultEnabledFeatures: PrivacyManager.Feature,     configObserver: RemoteConfigObserver = RemoteConfigObserver(dataStore),     resetEnabledFeatures: Boolean = false)

Types

Link copied to clipboard
class Feature @RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP]) constructor(rawValue: Int) : JsonSerializable

Properties

Link copied to clipboard

The current set of enabled features.

Link copied to clipboard

Checks if any feature is enabled.

Functions

Link copied to clipboard
fun disable(vararg features: PrivacyManager.Feature)

Disables features, removing them from the set of currently enabled features.

Link copied to clipboard
fun enable(vararg features: PrivacyManager.Feature)

Enables features, adding them to the set of currently enabled features.

Link copied to clipboard

Checks if any of the given features are enabled.

Link copied to clipboard

Checks if all of the given features are enabled.

Link copied to clipboard

Sets the current enabled features, replacing any currently enabled features with the given set.