Class AnalyticsConsent
granted(), denied() or builder()
and handed to Analytics.setConsent(AnalyticsConsent).-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturns a builder seeded with this object's current values so a single category can be toggled without rebuilding from scratch.static AnalyticsConsent.Builderbuilder()Creates a builder seeded with all categories denied.static AnalyticsConsentdenied()A consent object denying every category.static AnalyticsConsentgranted()A consent object granting every category.booleanConsent for advertising / ad storage.booleanConsent for screen views, events and user properties.booleanConsent for crash and exception reporting.booleanConsent for personalization (e.g. user-level identification).
-
Method Details
-
isAnalytics
public boolean isAnalytics()Consent for screen views, events and user properties.
Returns
true if behavioural analytics collection is permitted
-
isCrashReporting
public boolean isCrashReporting()Consent for crash and exception reporting.
Returns
true if crash reporting is permitted
-
isPersonalization
public boolean isPersonalization()Consent for personalization (e.g. user-level identification).
Returns
true if personalization is permitted
-
isAdStorage
public boolean isAdStorage()Consent for advertising / ad storage.
Returns
true if ad storage is permitted
-
granted
A consent object granting every category. Convenient when the user has accepted a single all-encompassing consent prompt.
Returns
consent with all categories granted
-
denied
A consent object denying every category. Equivalent to the implicit state before consent is recorded in
ConsentMode.OPT_IN.Returns
consent with all categories denied
-
builder
Creates a builder seeded with all categories denied.
Returns
a new builder
-
asBuilder
Returns a builder seeded with this object's current values so a single category can be toggled without rebuilding from scratch.
Returns
a builder pre-populated from this instance
-