# Consent Management in Mobile SDKs

<p>The <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/kotlin-sdk/" >Android (Kotlin)</a> and <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/swift-sdk/" >iOS (Swift)</a> SDKs now support <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/client-side-features/consent-management/" >consent management</a>. You pass the user&rsquo;s consent choices, and the SDK stamps every event and blocks device mode destinations the user has not allowed.</p>
<p>Your app keeps the consent UI. The SDK does not show a banner, store a choice, or ask the user anything.</p>
<p>Consent management is off by default. Apps that do not enable it behave exactly as before: events carry no consent block and no destination is blocked.</p>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">This feature supports the <strong>Custom</strong> consent provider only. Named consent managers such as OneTrust, Ketch, and iubenda are not supported yet. If you use one of those tools, read the user&rsquo;s choices from that SDK and pass them as custom consent category IDs.</div>
  </div>
</blockquote>

</html>
<p>See <a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/client-side-features/consent-management/" >Consent Management in Mobile SDKs</a> for how events are stamped and how device mode destinations are blocked.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="why-consent-management-in-the-mobile-sdks">Why consent management in the mobile SDKs?</h2><p>The legacy Android and iOS SDKs read a consent filter once, at startup. A change applied only on the next launch, and you had to decide destination by destination in code.</p>
<p>In the Kotlin and Swift SDKs you declare the user&rsquo;s choices, and each destination&rsquo;s <strong>Consent settings</strong> in the dashboard decide what is allowed. <code>setConsent</code> applies the new choices immediately, including mid-session.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="key-features">Key features</h2><ul>
<li><strong>Consent on every event</strong>: While consent management is active, each event carries <code>context.consentManagement</code> with the provider, <code>allowedConsentIds</code>, and <code>deniedConsentIds</code> from the moment the event was created. Cloud mode destinations are filtered server-side from that stamp.</li>
<li><strong>Device mode blocking</strong>: A destination the user has not allowed is never initialized and receives no events. Only <code>allowedConsentIds</code> gates a destination. <code>deniedConsentIds</code> is recorded on the event and is not used to resolve destinations.</li>
<li><strong>Runtime updates</strong>: <code>setConsent</code> replaces the current choices immediately. A newly allowed destination starts without an app restart. Events tracked while a destination was denied are not sent to it later.</li>
<li><strong>Your app owns persistence</strong>: Consent is held in memory for the session. Supply it again on every launch. <code>reset()</code> does not clear it, because consent is a device-level choice rather than a property of the signed-in user.</li>
</ul>

<html lang="en">
<blockquote class="info">
  <div class="tip-quote">
    
    <div class="tip-text">Consent management in the Kotlin SDK is available on Android only. It is not included in the server-side (JVM) artifact.</div>
  </div>
</blockquote>

</html>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="get-started">Get started</h2><p>Consent category IDs are case-sensitive. The IDs you pass to the SDK must match the dashboard exactly.</p>
<ol>
<li>Open the destination and go to <strong>Consent settings</strong>. Choose <strong>Custom</strong>, enter the consent category IDs, and set the logic to <code>AND</code> or <code>OR</code>.</li>
<li>Enable consent management when you initialize the SDK, and pass the user&rsquo;s current <code>allowedConsentIds</code> and <code>deniedConsentIds</code>. You cannot turn it on later in the session.</li>
<li>When the user changes their choices, call <code>setConsent</code> with the full set of choices, not only what changed.</li>
</ol>
<p>See <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> for the Kotlin, Java, Swift, and Objective-C snippets.</p>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="sdk-versions">SDK versions</h2><table>
<thead>
<tr>
<th><div>SDK</div></th>
<th>Minimum SDK version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Android (Kotlin)</td>
<td><code>com.rudderstack.sdk.kotlin.android</code> <code>1.8.0</code></td>
</tr>
<tr>
<td>iOS (Swift)</td>
<td><code>rudder-sdk-swift</code> (<code>RudderStackAnalytics</code>) <code>1.4.0</code></td>
</tr>
</tbody>
</table>
<!-- end-chunk -->
<!-- begin-chunk -->
<h2 id="resources">Resources</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>: How events are stamped, and how consent interacts with identity</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>: Dashboard setup, initialization, and <code>setConsent</code></li>
<li><a href="https://www.rudderstack.com/docs/sources/event-streams/sdks/client-side-features/consent-management/migrate-from-legacy-sdks/" >How to Migrate Consent Filters from the Legacy SDKs</a>: Replace <code>RSConsentFilter</code> and <code>RudderConsentFilter</code></li>
<li><a href="https://www.rudderstack.com/docs/data-governance/consent-management/custom-consent-manager/" >Custom Consent Management</a>: Provider setup and consent logic in the dashboard</li>
</ul>

