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.

Introduction

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:

Requirements

The following requirements are needed for App Tracking Transparency:

Platform

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.