Showing the banner
The banner has two layers. The first layer asks for consent with Accept and Reject. The preference center (second layer) lets the visitor turn individual categories on or off. Both are styled and translated from your dashboard.
Show the banner when configure reports that consent is still needed:
- Android
- iOS / tvOS
if (status.shouldCollectConsent) {
OptSensBanner.showFirstLayer(this)
}
Open the preference center directly with OptSensBanner.showSecondLayer(activity).
Present the OptSensBanner view (see
Getting started - iOS and tvOS) over your UI as
a sheet or full-screen cover. The first layer and the preference center are the
same view; the visitor moves between them with Manage.
Reopen consent later
GDPR and CCPA require the visitor to be able to change consent at any time. On
phone and tablet the floating button covers this,
but unlike the web it is not injected for you: you mount it once during
integration (Android attach, iOS overlay). Build your own control only if you
have turned the button off, or on TV, where the button is not shown. Wire any
control (a Settings
row, a menu item) to the geo-aware reopen path. It shows "Your Privacy Choices"
for a US privacy visitor and the preference center for everyone else.
- Android
- iOS / tvOS
OptSensBanner.showPreferences(activity)
@State private var showPrivacy = false
Button("Privacy settings") { showPrivacy = true }
.fullScreenCover(isPresented: $showPrivacy) {
OptSensReconsentView { showPrivacy = false }
}
The floating button is the ready-made version of this control. Banner design, languages and content are managed in your OptSens dashboard, not in the app.