# How to Migrate Consent Filters from the Legacy SDKs

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

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">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.</div>
  </div>
</blockquote>

</html>
<p>In the legacy SDKs you implemented a consent filter — <code>RSConsentFilter</code> on iOS, <code>RudderConsentFilter</code> 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&rsquo;s choices once and the SDK decides, using the consent settings configured on each destination in the dashboard.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="what-replaces-what">What replaces what</h2><table>
<thead>
<tr>
<th>Legacy</th>
<th>New</th>
</tr>
</thead>
<tbody>
<tr>
<td>The consent filter interface you implemented</td>
<td>Nothing to implement</td>
</tr>
<tr>
<td><code>withConsentFilter(...)</code> on the config builder</td>
<td><code>consentManagement</code> on <code>Configuration</code></td>
</tr>
<tr>
<td><code>getConsentCategoriesDict</code> / <code>getConsentCategoriesMap</code> entries set to <code>true</code></td>
<td><code>allowedConsentIds</code></td>
</tr>
<tr>
<td>The same entries set to <code>false</code></td>
<td><code>deniedConsentIds</code></td>
</tr>
<tr>
<td><code>filterConsentedDestinations(...)</code></td>
<td><strong>Consent settings</strong> on each destination in the dashboard</td>
</tr>
<tr>
<td>No equivalent</td>
<td><code>setConsent</code> for runtime changes</td>
</tr>
</tbody>
</table>
<p>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.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="what-you-gain">What you gain</h2><ul>
<li><strong>Consent changes take effect immediately.</strong> The legacy SDKs read your filter once, at startup, so a change only applied on the next app launch. <code>setConsent</code> applies right away.</li>
<li><strong>Destinations start mid-session.</strong> A destination the user newly allows is initialized without an app restart. The legacy SDKs never did this.</li>
<li><strong>A complete consent record on the event.</strong> The legacy SDKs stamped only the denied category IDs. Events now carry the provider and the allowed IDs as well.</li>
</ul>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="see-more">See more</h2><ul>
<li><a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/client-side-features/consent-management/" >Consent Management in Mobile SDKs</a></li>
<li><a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/client-side-features/consent-management/setup/" >How to Enable Consent Management in Mobile SDKs</a></li>
<li><a href="https://www.rudderstack.com/docs/data-governance/consent-management/overview/" >Consent Management Overview</a></li>
</ul>

