# FIRAnalytics(Consent)

Sets the applicable end user consent state.
- `


  ### [setConsent(_:)](https://firebase.google.com/docs/reference/swift/firebaseanalytics/api/reference/Categories/FIRAnalytics(Consent)#/c:objc(cs)FIRAnalytics(cm)setConsent:)


  ` 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: [https://firebase.google.com/docs/reference/swift/firebaseanalytics/api/reference/Type-Definitions.html#/c:FIRAnalytics+Consent.h@T@FIRConsentType : https://firebase.google.com/docs/reference/swift/firebaseanalytics/api/reference/Type-Definitions.html#/c:FIRAnalytics+Consent.h@T@FIRConsentStatus])

  #### Parameters

  |---|---|
  | ` consentSettings ` | A Dictionary of consent types. Supported consent type keys are `ConsentType.adStorage`, `ConsentType.analyticsStorage`, `ConsentType.adUserData`, and `ConsentType.adPersonalization`. Valid values are `ConsentStatus.granted` and `ConsentStatus.denied`. |