D
D
DSmith2021-09-09 23:59:02
iOS
DSmith, 2021-09-09 23:59:02

Xcode how to add ATTrackingManager?

There is an application written in react native for andorid and ios.
From time to time I just make some edits (in the visual part) and release them on google play and appstore.
Apple now requires AppTrackingTransparency support to be included in the application, otherwise it rejects the update.

I found the instruction and added the following to the AppDelegate.m file:

At the top of the file:

#import <AppTrackingTransparency/AppTrackingTransparency.h>


Next after
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{


contributed:
if (@available(iOS 14.0, *)) {
          [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
          // Tracking authorization completed. Start loading ads here.
          // [self loadAd];
          }];
}


Launched on the emulator, the application started, a request for tracking permission was issued, everything is fine.
I decided to compile (Archive) to send it to the appstore, at the end of the build it gives an error:
AppDelegate.m:43:12: Use of undeclared identifier 'ATTrackingManager'

Tell me what's wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question