Mobile & TV SDK
The OptSens SDK brings the consent banner into your native apps. It runs on iOS, Android and connected TV (Apple TV, Android TV, Fire TV), and it is managed from the same OptSens dashboard as your website. Your app and your website are separate properties: each has its own banner configuration and its own plan; you restyle the app banner without touching the website.
The SDK is available on the Pro, Business and Custom plans.
What the SDK does
- Shows the consent banner inside your app, in the visitor's language.
- Records each decision to your OptSens account, the same way the website does.
- Writes the standard IAB consent keys (TCF, GPP, US Privacy) on the device, so ad and analytics SDKs read the visitor's choice on their own.
- Forwards consent to Google Consent Mode and attribution partners.
- Gives you
OptSens.hasConsent("analytics")to gate your own tracking code.
On Android, forwarding consent to partners is automatic. On iOS, Google Consent Mode is automatic; a few attribution partners (AppsFlyer, Adjust, Branch) need one small code snippet, shown in the forwarding guide.
Platforms
| Platform | Minimum | Distribution |
|---|---|---|
| Android (phone, tablet, TV, Fire TV) | Android 5.0 (API 21) | Maven Central |
| iOS | iOS 16 | Swift Package Manager |
| tvOS (Apple TV) | tvOS 17 | Swift Package Manager |
One package per platform covers both phone and TV. The SDK detects a TV at runtime and switches to a large-screen, remote-controlled layout on its own.
How it relates to your website
The app and the website live under one OptSens account, but each is its own property with its own banner configuration and plan. What differs at runtime is how consent is enforced:
- On the web, OptSens blocks scripts and cookies until the visitor consents.
- In an app, there are no cookies to block. OptSens signals consent to the
operating system and to the SDKs you use (Google Consent Mode, IAB strings,
attribution partners), and you gate your own code with
hasConsent.
Add your app
You add an app from the same place as a website. Click Add Domain in the top navigation, then choose what you are adding:
- Choose Mobile app for iOS or Android, or TV app.
- For TV app, pick the platform. Apple TV, Android TV and Fire TV use this SDK. Samsung (Tizen) and LG (webOS) are web-TV and use the web script instead.
- Enter your app identifier, the bundle id or package name (for example
com.yourcompany.app). Samsung uses a Tizen id like3201234567890.YourApp. - Pick a plan (Pro, Business or Custom) and run the guided onboarding.
Your SDK ID is in the Integration step, and later on the dashboard Integration page.
What you will do
- Add the SDK to your app (Maven Central or Swift Package Manager).
- Call
OptSens.configurewith your SDK ID. - Show the banner when consent is needed.
- Forward consent and gate your own tracking.
Start with Getting started - Android or Getting started - iOS and tvOS.