Save the date - Google I/O returns May 18-20. Register to get the most out of the digital experience: Build your schedule, reserve space, participate in Q&As, earn Google Developer profile badges, and more. Register now

FirebaseAnalytics Framework Reference


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.



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



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