Sample App

Overview

OneTrust provides a demo app that teams can use as a reference to see how the SDK works and how to set it up. To download the demo app, follow these steps.

Launching the demo app

  1. Unzip the file downloaded above
  2. In Android Studio, open the OTPublishersNativeApp folder

Mobile Android

  1. Run the app
  2. Once the demo app is running, you'll be greeted with a Settings page that looks like this:
  1. Complete the fields, as follows:
FieldDescriptionOptional?
Domain URLCDN location for the SDK data. You can find this information in your tenant > Mobile App Consent > SDKs > Your App > Instructions. See examples below.No
Domain IDApplication ID for your app. You can find this information in your tenant > Mobile App Consent > SDKs > Your App > Instructions.No
LanguageEnter your two-letter or four-letter ISO language code. For example, en or en-GBfor English.No
Country CodeTwo-letter ISO country code. For example,US for United States or FR for France, etc.Yes
Region CodeTwo-letter ISO region code most commonly used for US states like CA for California.Yes
Data Subject IdentifierData subject identifier used to store a user's consent profile in OneTrust for metrics, reporting, audit, and cross device profile syncing. If no ID is specified, the SDK generates a random GUID.Yes
EnvironmentDomain URL to Use
app.cookiepro.comcookie-cdn.cookiepro.com
app-uk.onetrust.comcdn-ukwest.onetrust.com
app-au.onetrust.comcdn-au.onetrust.com
app-apac.onetrust.comcdn-apac.onetrust.com
app.onetrust.comcdn.cookielaw.org
app-de.onetrust.comcdn.cookielaw.org
app-eu.onetrust.comcdn.cookielaw.org
trial.onetrust.comcdn.cookielaw.org
uat.onetrust.comcdn.cookielaw.org
uat-de.onetrust.comcdn.cookielaw.org
  1. Click the Download SDK Data button
  2. Tap the Home button to head to the main page

Android TV

  1. Open the RenderTVUIActivity class in the sample app
  2. Set the cdnLocation, domainId and languagevalues
private static final String cdnLocation = "paste_cdn_location_of_your_app_here";
private static final String domainId = "paste_appId_of_your_app_here";
private static final String language = "en";
  1. Run the app