Page Contents

    App Tracking Transparency with the Native SDK for iOS

    In this topic, you will learn how to manage user privacy and data use with the Brightcove Native SDK for iOS.


    With iOS 14.5, there is a new privacy feature called App Tracking Transparency. You can use this feature in your apps to request tracking permission from your users. When users say no to tracking, the app will not be able to use Apple's ID for Advertisers (IDFA) or other identifiers, like hashed email addresses, to share data about their activity for ad-targeting.

    If your app collects end-user data and shares it with other companies for tracking purposes across apps and web sites, then you must use the AppTrackingTransparency framework.

    For details, see the following:


    The following requirements are needed for App Tracking Transparency:


    Here are the system requirements:

    • iOS or tvOS version 14.5 or newer

    Brightcove Native SDK

    It is recommended to use the latest version of the Native SDK.

    • Native SDK for iOS or tvOS version 6.8.0 or newer
    • For details, see the SDK release notes

    Prompt users about IDFA sharing

    The sample apps mentioned below show how to display the App Tracking Transparency alert to determine if your app can use the ID for Advertisers (IDFA) or not.

    1. Open and review either of the following sample apps:

    2. Open the BaseViewController, and locate the viewDidLoad method.
    3. For iOS 14, the SDK checks the value of ATTrackingManager.trackingAuthorizationStatus. If the value is ATTrackingManagerAuthorizationStatusAuthorized, then the SDK uses the IDFA.

      if (@available(iOS 14, *))
        __weak typeof(self) weakSelf = self;
        [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
            __strong typeof(weakSelf) strongSelf = weakSelf;
            dispatch_async(dispatch_get_main_queue(), ^{
                // Tracking authorization completed. Start loading ads here.
                [strongSelf videoLibrary];
                [strongSelf setupPlayerView];
                [strongSelf setupPlaybackController];
                [strongSelf requestVideo];
    4. For older iOS versions, the SDK uses the value of ASIdentifierManager.sharedManager.isAdvertisingTrackingEnabled to determine if the IDFA should be used.

    Prevent IDFA with IMA plugin

    When using the IMA SDK, you can prevent the Brightcove Native SDK for iOS from sending the IDFA, eliminating the prompt to opt-in. You can do this by setting the kBCOVIMAOptionBlockAdTargetingAPIsKey: true on the IMA session controller.

    Start with the BasicIMAPlayer sample code, as shown here:

    let imaPlaybackSessionOptions = [kBCOVIMAOptionIMAPlaybackSessionDelegateKey: self]
    guard let _playbackController = BCOVPlayerSDKManager.shared()?.createIMAPlaybackController(with: imaSettings, adsRenderingSettings: renderSettings, adsRequestPolicy: adsRequestPolicy, adContainer: playerView?.contentOverlayView, viewController: self, companionSlots: nil, viewStrategy: nil, options: imaPlaybackSessionOptions) 
      else {

    Update the code as follows:

    let manager = BCOVPlayerSDKManager.sharedManager(/* options: ["log_level":5] */)
    guard let basicSessionProvider = manager?.createBasicSessionProvider(with: nil) 
      else {
    let imaPlaybackSessionOptions = [kBCOVIMAOptionIMAPlaybackSessionDelegateKey: self, kBCOVIMAOptionBlockAdTargetingAPIsKey: true] as [String : Any]
    let imaSessionProvider = manager?.createIMASessionProvider(with: imaSettings, adsRenderingSettings: renderSettings, adsRequestPolicy: adsRequestPolicy, adContainer: self.playerView?.contentOverlayView, viewController: self, companionSlots: nil, upstreamSessionProvider: basicSessionProvider, options: imaPlaybackSessionOptions)
    guard let _playbackController = manager?.createPlaybackController(with: imaSessionProvider, viewStrategy: nil)
      else {

    Page last updated on 08 Oct 2021