Skip to main content

Requirements

  • iOS 13.0 or newer / tvOS 15.0 or newer.
  • Xcode (13.4 or newer recommended).
  • Bright SDK for iOS/tvOS (latest).
  • For Unity projects: Unity Editor 2020.2.5f1 or newer.
Bright Data must review your application before you submit it to the Apple App Store. Send your test build via TestFlight for review.

Important Notes

  • Take care when implementing the consent screen and the opt-out mechanisms in a way which follows guidelines in this document.
  • Users must always, voluntarily decide to opt in after seeing the consent screen, and must always have an easy way to opt out.
  • Bright Data recommends offering value in exchange for opting in (e.g., fewer ads, bonus coins, premium features). However, simply asking for user support is also acceptable.
  • Do not suggest Bright SDK as an alternative to paying for premium items or subscriptions via the App Store. This violates App Store policy.
  • Bright SDK does not do any user tracking. It is not related to Apple’s ATT (App Tracking Transparency). You may show the consent screen regardless of ATT status.
  • Bright Data reviews SDK integration after initial release and regularly thereafter. Your account will be terminated if you violate the guidelines in this document.
  • Starting from version 1.385.451, Bright SDK checks for parental controls. If enabled, the consent screen will NOT be displayed - this is by design to ensure informed consent.
1

Create App ID on Dashboard

If you haven’t done this yet, log in to your dashboard and create your app ID first.The App ID for iOS/tvOS apps is constructed as follows: ios_<your Apple Bundle ID>Example: If your Bundle ID is com.mycompany.MyGame, your App ID will be ios_com.mycompany.MyGame.
2

Install SDK Files

You can set up the Bright SDK framework in your iOS/tvOS app in two ways:
  • Using the Bright SDK Integration CLI Tool Recommended - automatically downloads the SDK, extracts the framework, and patches your Xcode project with the necessary references.
  • Manually - download the SDK from the dashboard, unzip it, and copy the files yourself.
Either way, you will still need to add the SDK initialization code to your app.
Run the tool using the bright-sdk-integration CLI. See the Apple example for full setup instructions.The tool will:
  • Download the latest BrightSDK zip from cdn.bright-sdk.com/static/
  • Extract brdsdk.xcframework into BrightSDK/
  • Patch your project.pbxproj - adding brdsdk.xcframework with Embed & Sign and setting FRAMEWORK_SEARCH_PATHS
  • Save brd_sdk.config.json for future runs
Once the tool completes, skip to Step 3 - Integrate Bright SDK.
Download the latest Bright SDK using the Bright SDK downloader. Unzip it.SDK Structure and overview
ComponentDescription
brdsdk.xcframeworkUniversal framework for Xcode. Contains iPhoneOS & Simulator builds. Min iOS: 13.0, Min tvOS: 15.0
unity_plugin/brdsdk.unitypackageUnity plugin package for Unity-level integration
unity_sample_app_2020.2.5Reference sample for Unity integration at the Unity Editor level
unity_xcode_sample_appReference sample for Unity integration at the Xcode level. Note: Missing UnityFramework.framework — build and copy it from your own project
sample_tvos_xcodeReference sample for tvOS Xcode integration
xcode_swiftui_sample_appReference sample for native iOS using SwiftUI
xcode_uikit_sample_appReference sample for native iOS using UIKit (Swift or Objective-C)
3

Integrate Bright SDK

Choose the integration path that matches your project type:
Project TypeIntegration Path
Native iOS (Swift)Step 3.1Step 3.2
Native iOS (Objective-C)Step 3.1Step 3.3
tvOSStep 3.1Step 3.4
Unity (Unity Editor level)Step 3.5
Unity (Xcode level)Step 3.1Step 3.6
1

3.1 Embedding the Framework in Xcode

This step is common to all Xcode-based integrations (native iOS, tvOS, and Unity at Xcode level).
CLI Tool users: The framework is already extracted and referenced in your .xcodeproj - confirm Embed & Sign is set and skip to 3.2.
  1. Copy brdsdk.xcframework into your app’s project folder (e.g., <MyProject>/Libraries)
  2. Open your project in Xcode
  3. In the Project Navigator (left pane), select the project at the top
  4. Select your app target under the Targets list Xcode Project Navigator
  5. Go to the General tab → scroll to Frameworks, Libraries, and Embedded Content
  6. Click +Add Other…Add Files
  7. Locate and select brdsdk.xcframework → click Open
  8. Confirm that it shows Embed & Sign next to brdsdk.xcframework Embed and Sign
2

3.2 Integration in Xcode (iOS – Swift)

Reference sample: xcode_swiftui_sample_app, xcode_uikit_sample_appShort steps:
  1. Import the framework: import brdsdk
  2. Initialize the SDK via the brd_api constructor (see example below). Typically done in the app delegate on the app-launched event.
  3. Show the consent screen:
    • Pass skip_consent: false → consent screen appears automatically on initialization
    • Pass skip_consent: true → you must call brd_api.show_consent() manually later
  4. To disable the SDK, call brd_api.opt_out()
It is not recommended to initialize the SDK on the main thread.
Here’s the example:Initialization:
do {
    try brd_api(
        benefit: "<BENEFIT>",
        agree_btn: "<AGREE>",
        disagree_btn: "<DISAGREE>",
        language: "en",
        skip_consent: true,
        campaign: nil
    ) { [weak self] choice in
        // handle updated choice
    }
    uuidTextField.text = brd_api.get_uuid()
} catch {
    let alert = UIAlertController(title: "Error", message: error.localizedDescription, preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "OK", style: .cancel))
    present(alert, animated: true)
}
Presenting the consent screen manually:
brd_api.show_consent(self)
Opting out:
brd_api.opt_out()
3

3.3 Integration in Xcode (iOS – Objective-C)

Reference sample: xcode_uikit_sample_appShort steps:
  1. Import the framework: #import <brdsdk/brdsdk.h>
  2. Initialize the SDK by calling brd_api constructor. Typically done in the app delegate on the app-launched event.
  3. Show the consent screen:
    • Pass NO to skip_consent → consent screen appears automatically on initialization
    • Pass YES to skip_consent → you must call [brd_api show_consent] manually later
  4. To disable the SDK, call [brd_api opt_out]
It is not recommended to initialize the SDK on the main thread.
Here’s the example:Initialization:
NSError *error = nil;
__weak typeof(self) wSelf = self;

(void)[[brd_api alloc] initWithBenefit:NULL
                             agree_btn:NULL
                          disagree_btn:NULL
                  opt_out_instructions:NULL
                               appicon:[UIImage imageNamed:@"appicon"]
                                   cwd:NULL
                           sys_app_id:NULL
                              language:NULL
                                colors:NULL
                      background_image:background
                           opt_in_info:NULL
                          opt_out_info:NULL
                                 fonts:NULL
                          skip_consent:YES
                              campaign:NULL
                                 error:&error
                      on_choice_change:^(NSInteger choice) {
    // handle updated choice
}];
Presenting the consent screen manually:
[brd_api show_consent:self benefit:@"<BENEFIT>" agree_btn:@"<AGREE>" disagree_btn:@"<DISAGREE>" language:@"en"];
Opting out:
[brd_api opt_out];
4

3.4 Integration in Xcode (tvOS)

Reference sample: sample_tvos_xcode
Note: Please contact our partnership managers to share information about your tvOS app before beginning implementation.
Bright SDK must show a consent screen right after the app is launched. Your app must initialize the main screen first, show the consent screen, and only then pass control to other functions/screens.
  1. Embed the framework - follow Step 3.1.
  2. Open SampleAppApp.swift from sample_tvos_xcode and implement similar SDK initialization logic in your app.
  3. Open SettingsView.swift from sample_tvos_xcode and implement the settings screen similarly:
    • Web Indexing section should have Enable and Disable buttons.
    • Button actions delegate to enableIndexingCallback, then to ContentViewModel.setIndexing(enable:, callback:) (defined in ContentView.swift), which calls:
      • brd_api.show_consent() - to enable the SDK.
      • brd_api.opt_out() - to disable the SDK.
5

3.5 Integration in Unity Editor

This section will guide you on how to integrate SDK at Unity level (no code changes in Xcode).Reference sample: unity_sample_app_2020.2.5, unity_admob_sample_appUse this path if you want to integrate Bright SDK entirely at the Unity level without modifying Xcode. If you prefer to integrate at the Xcode level instead, skip to Step 3.6. Do not follow both - choose one.
If you have other 3rd-party frameworks that need to initialize before your game launches, integrating via the Unity plugin ensures the correct user flow: Bright SDK consent screen → 3rd party initialization → game launch.
We recommend Unity Editor 2020.2.5f1. If you encounter issues, use unity_sample_app_2020.2.5 as a reference.3.5.1 Import the SDK Package
  1. In Unity Editor, go to Assets → Import Package → Custom Package
  2. Select brdsdk.unitypackage from the unity_plugin folder
  3. In the Import Unity Package dialog, click Import
    • This adds brdsdk.framework, BrdsdkBridge.cs, and other required files
  4. Confirm there are no compilation errors
3.5.2 Add SDK Initialization to Your Code
  1. Open BrightDataSDK/BrdsdkBridge.cs and review the available SDK API calls
  2. Call BrdsdkBridge.init(...) from the Start() method of your game object handler (e.g., instead of direct ad initialization)
  3. Implement the on_choice_callback method properly - see BrightDataSDK/Sample/SampleBehaviour.cs for an example. The result of consent will be delivered via this callback.
  4. Implement the Settings screen following Step 4: Add Opt-In/Out Settings Option, using BrightDataSDK/Sample/SettingsBehaviour.cs as a reference
3.5.3 Generate the Xcode Project
  1. Go to File → Build Settings and switch to the iOS platform
  2. Click Player Settings:
    • Scroll to Other Settings
    • Set Target SDK to Device SDK
    • Set Target minimum iOS Version to 12 or higher
    • Update Bundle Identifier and other settings as needed
  3. Close Player Settings
  4. In Build Settings, click Build and choose the destination folder
  5. Wait for the Xcode project to be generated
3.5.4 Run the App on a Device
  1. Select the main project scheme (usually selected by default)
  2. Connect your iPhone and select it as the target device
  3. Configure Signing & Capabilities for the main project target
  4. Confirm New Build System is selected: File → Project Settings → Build System
  5. Press Product → Run (⌘R)
6

3.6 Integration in Xcode (Unity)

This section will guide you on how to integrate SDK in Xcode level (no code changes in Xcode).Reference sample: unity_xcode_sample_appUse this path if you want to integrate Bright SDK at the Xcode level for a Unity project. If you already completed Step 3.5, skip this section.Unity generates an Xcode project when building for iOS. The default template passes app lifecycle control to UnityFramework immediately after launch. Bright SDK must show the consent screen before the game launches, so your app must initialize the root view controller, show consent, and only then pass control to UnityFramework.Use unity_xcode_sample_app as reference. This is based on Unity’s official documentation for integrating Unity as a library into a standard iOS app, simplified to the minimum steps needed for Bright SDK.
If you have other 3rd-party frameworks that need to initialize before your game launches, consider using Step 3.5 (Unity Editor integration) instead.
3.6.1 Embed the Bright SDK Framework
  1. Follow Step 3.1 for the main app target.
  2. Additionally, link brdsdk.xcframework with UnityFramework:
    • In Project Navigator, select the project → select UnityFramework under Targets.
    • Go to Build Phases → expand Link Binary With Libraries.
    • Click +, select brdsdk.xcframework, click Add.
    Build Phases Link Binary
3.6.2 Embed the SDK Dialog in Your CodeConsent UI MockupUsing unity_xcode_sample_app as a reference:
  1. Copy the contents of unity_xcode_sample_app/main/main.m into MainApp/main.mm of your Unity project.
  2. Open MainApp/main.mm and locate loadBrightFramework - set appropriate button titles for the consent screen:
    agree_btn:"PeerTextREMOVE_ADS"
    disagree_btn: "NotPeerTextADS"
    
  3. If you offer ads as a monetization fallback, locate loadUnityFramework and enable your ad platform:
    if (useMonetizationFallback) {
        // TODO: user did not agree to share resources with BrightData
        // set up showing advertisements instead
    
  4. Embed the Data folder into UnityFramework.framework:
    • Select the Data folder in Project Navigator.
    • In the Inspector pane (right side), find Target Membership.
    • Move the checkbox to the UnityFramework target.
    Target Membership Checkbox
4

Add Opt-In/Out Settings Option

6

App Performance

We prioritize user experience. Ensure your app maintains good performance.Performance Guidelines:
  1. ✅ No input lag - ensure responsive UI interactions.
  2. ✅ Average CPU load: ≤ 50%.
  3. ✅ RAM usage: ≤ 90%.
Important: If system load is too high, we cannot use the device’s free resources. Such devices will not be counted as active and will not generate revenue.
7

Build & Run Your App

Native iOS / tvOS - Use Xcode to build and run your app. Ensure New Build System is selected under File → Project Settings.Unity After generating the Xcode project
  1. Select the main project scheme.
  2. Connect your iPhone/Apple TV and select it as the target device.
  3. Configure Signing & Capabilities for the main target.
  4. Press Product → Run (⌘R).
8

Update Your Terms of Service

9

Submit Your Integration for Review

10

How to Update the SDK

11

API Documentation

1

Part 1: Unity Plugin

Constants:
ConstantDescription
CHOICE_NONEConsent screen has not yet been shown
CHOICE_AGREEDUser accepted the consent screen
CHOICE_DISAGREEDUser declined the consent screen
Methods:
MethodReturnsDescription
init(...)voidInitializes the SDK. Must be called at app startup. All other methods are accessible after successful initialization.
opt_out()voidDisables Bright SDK (e.g. from Settings screen)
enqueue_opt_out()voidEnqueues an opt-out action to be executed once the SDK is loaded and configured
external_opt_in()boolOpts in and starts the Bright SDK process if permitted. ⚠️ NOT allowed by default — always use show_consent() or consult Bright Data first. Returns true if permitted.
enqueue_external_opt_in()voidEnqueues an opt-in action once SDK is loaded. Checks authorization status before and after enqueueing.
show_consent(benefit, agree_btn, disagree_btn, language)boolShows the consent screen (e.g. when user toggles Settings switch to enable SDK)
get_choice()intReturns the user’s current choice
consent_shown()boolTriggers post-actions when a custom consent screen is shown. Must be called when presenting a custom consent screen. Returns false if SDK authorization status is not Authorized.
authorize_device()AuthorizationStatusChecks SDK availability on the device. Required before showing a custom consent screen; optional otherwise.
get_uuid()stringReturns the current SDK UUID, or null if SDK is not initialized
set_on_sdk_ready_callback(callback)voidSets a handler for when the SDK is configured and ready
set_on_consent_presented_callback(callback)voidSets a handler for when the consent screen is presented
set_on_consent_closed_callback(callback)voidSets a handler for when the consent screen is dismissed (via close, agree, or disagree)
init() Initializes the SDK. Must be called at app startup. All other methods are accessible after successful initialization. Consent screen is shown on first initialization by default - skip by setting skip_consent: true.
static void init(
    string benefit,
    string agree_btn,
    string disagree_btn,
    string opt_out_instructions,
    string appicon,
    ChoiceCallback on_choice_callback,
    bool skip_consent = false,
    string language = null,
    ConsentColors colors = null,
    ConsentBackgroundImage background_image = null,
    ConsentActionInfo opt_in_info = null,
    ConsentActionInfo opt_out_info = null,
    ConsentFontsInfo fonts = null,
    string campaign = null
)
ParameterTypeDescription
benefitstring?Benefit text shown on the consent screen
agree_btnstring”Agree” button text
disagree_btnstring”Disagree” button text
opt_out_instructionsstring?Instructions for opting out
appiconstring?xcassets name or path of the icon image
on_choice_callbackChoiceCallbackCallback method reference
skip_consentboolSkip consent screen on init; show later via show_consent
languagestring?Preferred language (see supported values below)
colorsConsentColors?Consent screen colors
background_imageConsentBackgroundImage?Background images for consent screen
opt_in_infoConsentActionInfo?Opt-in button customization
opt_out_infoConsentActionInfo?Opt-out button customization
fontsConsentFontsInfo?Font overrides for consent screen
campaignstring?Campaign name
Supported language values: ar_SA, de-DE, en-US, es-ES, fa-AF, fr-FR, he-IL, hi-IN, it-IT, ja-JP, ko-KR, ms-MY, nl-NL, pt-PT, ro-RO, ru-RU, th, tr-TR, vi-VN, zh-CN, zh-TWopt_out() Disables Bright SDK (e.g. from Settings screen).
static void opt_out()
enqueue_opt_out() Enqueues an opt-out action to be executed once the SDK is loaded and configured.
static void enqueue_opt_out()
external_opt_in() Opts in and starts the Bright SDK process if permitted.
NOT allowed by default. Always use show_consent() or consult Bright Data first.
Returns true if the operation is permitted by the authorization device.
static bool external_opt_in()
enqueue_external_opt_in() Enqueues an opt-in action to be executed once the SDK is loaded and configured. Also checks authorization status before and after enqueueing.
static void enqueue_external_opt_in()
show_consent() Shows the consent screen (e.g. when the user toggles the Settings switch to enable SDK).
static bool show_consent(string benefit, string agree_btn, string disagree_btn, string language)
get_choice() Returns the user’s current choice.
static int get_choice()
consent_shown() Triggers post-actions when a custom consent screen is shown. Must be called when presenting a custom consent screen. Returns false if SDK authorization status is not Authorized.
static bool consent_shown()
authorize_device() Checks SDK availability on the device. Required before showing a custom consent screen; optional otherwise.
static BrdsdkBridge.AuthorizationStatus authorize_device()
get_uuid() Returns the current SDK UUID, or null if SDK is not initialized.
static string get_uuid()
set_on_sdk_ready_callback() Sets a handler for when the SDK is configured and ready.
static void set_on_sdk_ready_callback(EmptyCallback callback)
set_on_consent_presented_callback() Sets a handler for when the consent screen is presented.
static void set_on_consent_presented_callback(EmptyCallback callback)
set_on_consent_closed_callback() Sets a handler for when the consent screen is dismissed (via close, agree, or disagree).
static void set_on_consent_closed_callback(EmptyCallback callback)
Enum: BrdsdkBridge.AuthorizationStatus
ValueDescription
AuthorizedSDK can be used with either SDK’s or custom consent screen
SDKNotInitializedSDK has not been initialized
ParentControlEnabledParental controls are enabled — do not use SDK
OnlySDKConsentOnly the SDK’s built-in consent screen may be used; external_opt_in is not allowed
PlatformNotSupportedAuthorization method called on unsupported platform
Class: ConsentColors
PropertyTypeDescription
backgroundColorInt32Consent window background color
titleColorInt32Title text color
consentMessageColorInt32Main message text color
consentLinksColorInt32Main message link color
privacyColorInt32Privacy/license text color
privacyLinksColorInt32Privacy/license link color
iconsForegroundColorInt32Icon foreground color
iconsBackgroundColorInt32Icon background color
Class: ConsentBackgroundImage
PropertyTypeDescription
portraitImageStringxcassets name or file path for portrait image
landscapeImageString?xcassets name or file path for landscape image. Falls back to portrait if null
scaleModeConsentBackgroundImage.ScaleModeScale mode for the image view
Enum: ConsentBackgroundImage.ScaleMode
ValueDescription
ScaleToFillScales to fill, may change aspect ratio
ScaleAspectFitScales to fit, maintains aspect ratio, transparent areas remain
ScaleAspectFillScales to fill, maintains aspect ratio, may clip content
Class: ConsentActionInfo
public ConsentActionInfo(
    string _backgroundImage,
    string _textImage,
    Int32? _backgroundColor,
    Int32? _textColor
)
ParameterTypeDescription
_backgroundImagestring?Path or xcassets name for button background. Uses backgroundColor if null
_textImagestring?Path or xcassets name for button title image. Uses textColor if null
_backgroundColorInt32?Button background color
_textColorInt32?Button text color
PropertyTypeDescription
titleTextConsentFontFont for consent title
mainTextConsentFontFont for main description
licenseTextConsentFontFont for license text
iconsTextConsentFontFont for under-icon texts
buttonsTextConsentFontFont for button texts
Class: ConsentFontsInfo.ConsentFont
public ConsentFont(string _nameOrPath, float _size)
ParameterTypeDescription
_nameOrPathstringRegistered font name or path to font file
sizefloatFont size
2

Part 2: Swift / Objective-C

The APIs are identical for Swift and Objective-C - they differ in syntax only. For Objective-C, the init call must be made on a brd_api instance: [[brd_api alloc] init...]
Properties:
PropertyTypeDescription
onConsentPresented(() -> Void)?Handler when consent screen is presented
onConsentClosed(() -> Void)?Handler when consent screen is dismissed
onSDKReady(() -> Void)?Handler when SDK is configured and ready
Methods:
MethodReturnsDescription
init(...)Initializes the SDK. Throws brd_api.api_error.
opt_out()voidDisables Bright SDK (e.g. from Settings screen)
enqueue_opt_out()voidEnqueues opt-out to be executed once SDK is loaded and configured
external_opt_in()BoolOpts in and starts the Bright SDK process if permitted. ⚠️ NOT allowed by default — always use show_consent() or consult Bright Data first. Throws brd_api.api_error.
enqueue_external_opt_in()voidEnqueues opt-in action once SDK is loaded. Checks authorization status before and after enqueueing.
show_consent(_:benefit:agree_btn:disagree_btn:language:)BoolShows the consent screen. Returns true if SDK is initialized and child control is disabled. Result delivered via on_choice_change callback.
get_choice()IntReturns the user’s current choice
consent_shown()BoolTriggers post-actions when a custom consent screen is shown. Returns false if authorization status is not authorized.
authorizeDevice()AuthorizationStatusChecks SDK availability. Required before showing a custom consent screen; optional otherwise.
get_uuid()String?Returns current SDK UUID, or nil if SDK is not initialized
init() Initializes the SDK. Throws brd_api.api_error.
init(
    benefit: String? = nil,
    agree_btn: String? = nil,       // Default: "I Agree"
    disagree_btn: String? = nil,    // Default: "I Disagree"
    opt_out_instructions: String? = nil,
    appicon: UIImage? = nil,
    cwd _cwd: URL? = nil,
    sys_app_id: String? = nil,
    language: String? = nil,
    colors: ColorSettings? = nil,
    background_image: ConsentBackgroundImage? = nil,
    opt_in_info: ConsentActionInfo? = nil,
    opt_out_info: ConsentActionInfo? = nil,
    fonts: ConsentFontsInfo? = nil,
    skip_consent: Bool,
    campaign: String?,
    on_choice_change: ((Int)->Void)? = nil
) throws
ParameterTypeDescription
benefitString?Benefit text prefix. Default: "To support <app_name>"
agree_btnString?”Agree” button text. Default: "I Agree"
disagree_btnString?”Disagree” button text. Default: "I Disagree"
opt_out_instructionsString?Opt-out instructions text
appiconUIImage?Icon image for consent screen
languageString?Preferred language (same values as Unity — see above)
colorsColorSettings?Color settings for consent screen
background_imageConsentBackgroundImage?Background images for consent screen
opt_in_infoConsentActionInfo?Opt-in button customization
opt_out_infoConsentActionInfo?Opt-out button customization
fontsConsentFontsInfo?Font overrides
skip_consentBoolSkip consent on init; show later via show_consent
campaignString?Campaign name
on_choice_change((Int)->Void)?Callback for choice updates
opt_out() Disables Bright SDK (e.g. from Settings screen).
static func opt_out()
enqueue_opt_out() Enqueues opt-out to be executed once the SDK is loaded and configured.
static func enqueue_opt_out()
external_opt_in() Opts in and starts the Bright SDK process if permitted.
NOT allowed by default. Always use show_consent() or consult Bright Data first.
Returns true if permitted. Throws brd_api.api_error.
public static func external_opt_in() throws
enqueue_external_opt_in() Enqueues opt-in action once the SDK is loaded. Checks authorization status before and after enqueueing.
static func enqueue_external_opt_in()
show_consent() Shows the consent screen (e.g. when user activates the Settings toggle). Returns true if SDK is initialized and child control is disabled. Result delivered via on_choice_change callback.
static func show_consent(_ parent: UIViewController?, benefit: String?,
                         agree_btn: String?, disagree_btn: String?, language: String?) -> Bool
get_choice() Returns the user’s current choice.
static func get_choice() -> Int
consent_shown() Triggers post-actions when a custom consent screen is shown. Must be called when presenting a custom consent screen. Returns false if authorization status is not authorized.
static func consent_shown() -> Bool
authorizeDevice() Checks SDK availability. Required before showing a custom consent screen; optional otherwise.
static func authorizeDevice() -> AuthorizationStatus
Usage example:
let authStatus = brd_api.authorizeDevice()

switch authStatus {
    case .sdkNotInitialized:     break // initialize SDK first
    case .parentControlEnabled:  break // do not use SDK
    case .authorized:
        if Feature.customConsent {
            // show your own consent screen
        } else {
            fallthrough // show SDK's consent screen
        }
}
get_uuid() Returns current SDK UUID, or nil if SDK is not initialized.
static func get_uuid() -> String?
Enum: Choice
ValueDescription
noneConsent screen has not yet been shown
peerUser accepted the consent screen
notPeerUser declined the consent screen
Enum: brd_api.AuthorizationStatus
ValueDescription
AuthorizedSDK can be used with either SDK’s or custom consent screen
SDKNotInitializedSDK has not been initialized
ParentControlEnabledParental controls are enabled - do not use SDK
PlatformNotSupportedAuthorization method called on unsupported platform
Enum: brd_api.api_error
CaseDescription
init_error(String)Non-categorized initialization error
opt_in_not_allowedCalling *opt_in is not allowed — use SDK’s consent screen instead
sdk_not_initializedMethod called before SDK was initialized
enabled_parent_controlParental controls enabled — do not use SDK
Class: ConsentBackgroundImage
PropertyTypeDescription
portraitImageUIImageImage for portrait orientation
landscapeImageUIImageImage for landscape orientation
scaleModeUIView.ContentModeScale mode for image view
Constructors:
// With UIImage instances:
init(portrait: UIImage, landscape: UIImage? = nil, scaleMode: UIView.ContentMode = .scaleAspectFill)

// With xcassets names:
init?(portraitName: String, landscapeName: String? = nil, scaleMode: UIView.ContentMode = .scaleAspectFill, in bundle: Bundle = .main)
ParameterTypeDescription
portrait / portraitNameUIImage / StringPortrait image or xcassets name
landscape / landscapeNameUIImage? / String?Landscape image or xcassets name. Falls back to portrait if nil
scaleModeUIView.ContentModeScale mode. Use .scaleAspectFit or .scaleAspectFill
bundleBundleBundle containing xcassets
Class: ConsentActionInfo
PropertyTypeDescription
backgroundImageUIImage?Button background image. Uses background color if nil
textImageUIImage?Button title image. Uses title text if nil
backgroundColorUIColor?Background color. Falls back to ColorSettings.button_color if nil
textColorUIColor?Text color. Falls back to ColorSettings.button_color if nil
Constructors:
// With UIImage instances:
init(backgroundImage: UIImage? = nil, textImage: UIImage? = nil, backgroundColor: UIColor? = nil, textColor: UIColor? = nil)

// With xcassets names:
init(backgroundName: String?, textName: String? = nil, in bundle: Bundle = .main)
Class: ColorSettings
PropertyTypeDescription
background_colorUIColor?Consent window background color
title_colorUIColor?Title text color
consent_text_colorUIColor?Main message text color
consent_links_colorUIColor?Main message link color
privacy_text_colorUIColor?Privacy/license text color
privacy_links_colorUIColor?Privacy/license link color
qr_foreground_colorUIColor?QR code foreground color (tvOS only)
qr_background_colorUIColor?QR code background color (tvOS only)
icons_foreground_colorUIColor?Icon foreground color
icons_background_colorUIColor?Icon background color
Constructor:
init(background_color: UIColor? = nil, title_color: UIColor? = nil,
     consent_text_color: UIColor? = nil, consent_links_color: UIColor? = nil,
     privacy_text_color: UIColor? = nil, privacy_links_color: UIColor? = nil,
     qr_foreground_color: UIColor? = nil, qr_background_color: UIColor? = nil,
     icons_foreground_color: UIColor? = nil, icons_background_color: UIColor? = nil)
PropertyTypeDescription
titleTextUIFont?Font for consent title
mainTextUIFont?Font for main descriptions
licenseTextUIFont?Font for license text
iconsTextUIFont?Font for under-icon texts
buttonsTextUIFont?Font for button texts
Constructor:
init(titleText: UIFont? = nil, mainText: UIFont? = nil,
     licenseText: UIFont? = nil, iconsText: UIFont? = nil,
     buttonsText: UIFont? = nil)
Instance Methods (all return Self for chaining; all warn on invalid font; all subject to SDK size limits):
MethodDescription
setTitleText(withNameOrPath:size:)Override title font by name or file path
setMainText(withNameOrPath:size:)Override main text font by name or file path
setLicenseText(withNameOrPath:size:)Override license text font by name or file path
setIconsText(withNameOrPath:size:)Override under-icons text font by name or file path
setButtonsText(withNameOrPath:size:)Override buttons font by name or file path
Method signature:
func set<Element>Text(withNameOrPath nameOrPath: String, size: CGFloat) -> Self