How to Migrate Consent Filters from the Legacy SDKs

Replace legacy consent filters with consentManagement and setConsent in the Kotlin and Swift SDKs.

This guide applies if you are moving from the legacy Android (Java) SDK or the legacy iOS (Objective-C) SDK.

There is nothing to migrate at the data level. The legacy SDKs never stored consent, and your consent category IDs stay exactly as your consent platform defines them. This is a code change only.

In the legacy SDKs you implemented a consent filter — RSConsentFilter on iOS, RudderConsentFilter on Android. It handed the SDK two maps: one marking each of your consent categories allowed or denied, and one marking each device mode destination on or off. In the new SDKs you declare the user’s choices once and the SDK decides, using the consent settings configured on each destination in the dashboard.

What replaces what

LegacyNew
The consent filter interface you implementedNothing to implement
withConsentFilter(...) on the config builderconsentManagement on Configuration
getConsentCategoriesDict / getConsentCategoriesMap entries set to trueallowedConsentIds
The same entries set to falsedeniedConsentIds
filterConsentedDestinations(...)Consent settings on each destination in the dashboard
No equivalentsetConsent for runtime changes

Your existing category map splits into the two ID lists by its boolean value — that is the whole mapping. The destination-by-destination map has no code equivalent: that decision now lives in the dashboard.

What you gain

  • Consent changes take effect immediately. The legacy SDKs read your filter once, at startup, so a change only applied on the next app launch. setConsent applies right away.
  • Destinations start mid-session. A destination the user newly allows is initialized without an app restart. The legacy SDKs never did this.
  • A complete consent record on the event. The legacy SDKs stamped only the denied category IDs. Events now carry the provider and the allowed IDs as well.

See more

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.