Skip to main content

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.

info

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.
note

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

PlatformMinimumDistribution
Android (phone, tablet, TV, Fire TV)Android 5.0 (API 21)Maven Central
iOSiOS 16Swift Package Manager
tvOS (Apple TV)tvOS 17Swift 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:

  1. Choose Mobile app for iOS or Android, or TV app.
  2. 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.
  3. Enter your app identifier, the bundle id or package name (for example com.yourcompany.app). Samsung uses a Tizen id like 3201234567890.YourApp.
  4. 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

  1. Add the SDK to your app (Maven Central or Swift Package Manager).
  2. Call OptSens.configure with your SDK ID.
  3. Show the banner when consent is needed.
  4. Forward consent and gate your own tracking.

Start with Getting started - Android or Getting started - iOS and tvOS.