Check out what’s new from Firebase@ Google I/O 2021, and join our alpha program for early access to the new Remote Config personalization feature. Learn more

FirebaseAnalytics Framework Reference

FIRAnalytics(Consent)

Sets the applicable end user consent state.

  • Sets the applicable end user consent state (e.g. for device identifiers) for this app on this device. Use the consent settings to specify individual consent type values. Settings are persisted across app sessions. By default consent types are set to ConsentStatus.granted.

    Declaration

    Swift

    class func setConsent(_ consentSettings: [ConsentType : ConsentStatus])

    Parameters

    consentSettings

    An NSDictionary of consent types. Supported consent type keys are ConsentType.adStorage and ConsentType.analyticsStorage. Valid values are ConsentStatus.granted and ConsentStatus.denied.