> ## Documentation Index
> Fetch the complete documentation index at: https://developer.onetrust.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sample App

# Overview

Once you have downloaded the Native SDK scripts from the OneTrust application, you can begin testing in a demo application simulator using the files in the SDK package. To download the demo app, follow these [steps](https://developer.onetrust.com/onetrust/docs/download-the-sdk-ios-tvos-legacy). For more information on how to publish SDKs, see [Publishing the Mobile App Consent SDKs](https://my.onetrust.com/s/article/UUID-01f11650-296b-0ab5-13e8-476393499f0e).

## To open the SDK files

1. Extract the .zip file downloaded from the Admin UI. Folder hierarchy will be presented as in the screenshot below:

[block:image]{"images":[{"image":["https://files.readme.io/ca8f0c02cacec5e162e9a95fa6b2d5b1e440e14b606251e6deb055473a4f27a7-Screenshot_2024-10-14_at_11.48.23_AM.png","",""],"align":"center"}]}[/block]

2. Move the **OTPublishersHeadlessSDK.xcframework** folder inside **OTPublishersNativeApp** or **OTPublishersNativeAppTvOS**.

[block:image]{"images":[{"image":["https://files.readme.io/af1743188a03fc3f89fb2175e74be406e34af6f76ca35fff9bb9c248895b9d48-Screenshot_2024-10-14_at_11.44.17_AM.png","",""],"align":"center"}]}[/block]

3. Open one of the following:
   * **OTPublishersNativeApp > OTPublishersNativeApp.xcodeProj** file.
   * **OTPublishersNativeAppTvOS > OTPublishersNativeAppTvOS.xcodeProj** file.
4. Select the target device and click the **Play** button.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/24a663ea59a374890fc0534d3089d196e845a4843cc9a8d7ba0ffd62b101bddc-image.png",
        null,
        "iOS example"
      ],
      "align": "center",
      "sizing": "600px",
      "border": true,
      "caption": "iOS example"
    }
  ]
}
[/block]

## To run the app

5. Wait for the Simulator to load then navigate to the **Settings** view.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/1318c4ab3a0e1ef3f79193eb1d1f4822bc88bc959bfaecce057eece134ec7a0d-image.png",
        null,
        "iOS"
      ],
      "align": "center",
      "sizing": "250px",
      "border": true,
      "caption": "iOS"
    }
  ]
}
[/block]

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/7748311f66ff701e56b7e1faa5ffa8b94c64383a0364d56262a189df96ec316b-image.png",
        null,
        "tvOS"
      ],
      "align": "center",
      "sizing": "500px",
      "border": true,
      "caption": "tvOS"
    }
  ]
}
[/block]

6. Complete the fields, as follows:

| Field                   | Description                                                                                                                                                                                                        |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Domain URL              | CDN location for the SDK data. For more information, see **Domain URL by Environment** below.                                                                                                                      |
| Domain ID               | Application ID for your app. Navigate to **Mobile App Consent > SDKs > Your App > Instructions** in your tenant to find this information.                                                                          |
| Language                | Your two-letter or four-letter ISO language code. For example, `en` or `en-GB` for English.                                                                                                                        |
| Country Code            | Optional two-letter ISO country code. For example,`US` for United States or `FR` for France, etc.                                                                                                                  |
| Region Code             | Optional two-letter ISO region code most commonly used for US states like `CA` for California.                                                                                                                     |
| Data Subject Identifier | Optional data subject identifier value 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. |

> 📘
>
> The value of the Domain URL field is determined based on your tenant's environment.  Use the following table to identify the correct value.

| Environment            | Domain URL to Use          |
| ---------------------- | -------------------------- |
| training0.onetrust.com | otcc-training.onetrust.com |
| training1.onetrust.com | otcc-training.onetrust.com |
| demo0.otprivacy.com    | otcc-demo.otprivacy.com    |
| demo1.otprivacy.com    | otcc-demo.otprivacy.com    |
| demo2.otprivacy.com    | otcc-demo.otprivacy.com    |
| app.cookiepro.com      | cookie-cdn.cookiepro.com   |
| app-uk.onetrust.com    | cdn-ukwest.onetrust.com    |
| app-au.onetrust.com    | cdn-au.onetrust.com        |
| app-apac.onetrust.com  | cdn-apac.onetrust.com      |
| app.onetrust.com       | cdn.cookielaw\.org         |
| app-de.onetrust.com    | cdn.cookielaw\.org         |
| app-eu.onetrust.com    | cdn.cookielaw\.org         |
| free.onetrust.com      | cdn.cookielaw\.org         |
| trial.onetrust.com     | cdn.cookielaw\.org         |
| uat.onetrust.com       | cdn.cookielaw\.org         |
| uat-de.onetrust.com    | cdn.cookielaw\.org         |

> 📘
>
> Translated language text depends on your template's settings managed on the OneTrust tenant.  OneTrust provides default template text that is pre-translated across many languages.  When you change the default template text, you will also need to setup the languages you wish to support and the translation text you wish to show. Otherwise, English text will be provided regardless of the language code provided.

7. Click the **Download SDK Data** button. The SDK data will download to the demo application.

8. By returning to the **Home** screen, you can then select **Show Banner** or **Show Preference Center** to see how the Native SDK will display consent preferences for the application.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/e4fa7bdb2e8fc04ecdda80ad4e8f43cfa45279241fcdddcbcaa6aa559bbef1a0-image.png",
        null,
        ""
      ],
      "align": "center",
      "sizing": "250px",
      "border": true
    }
  ]
}
[/block]