IOS15 not showing ATT prompt using applicationDidBecomeActive

Hey guys, recently my proyect stop showing the ATT prompt and I cant find where is the problem when it worked perfect before. Previously I was using didFinishLaunchingWithOptions but i saw some post where said that was the problem and some solve the problem by changing to applicationDidBecomeActive. This is my current AppDelegate.m

#import "AppDelegate.h"
#import "MainViewController.h"
#import <AppTrackingTransparency/AppTrackingTransparency.h>
@implementation AppDelegate
- (void)applicationDidBecomeActive(UIApplication*)application
{
    self.viewController = [[MainViewController alloc] init];
    if (@available(iOS 14, *)) {
        [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
            //If you want to do something with the pop-up
        }];
    }
}@end

While pre IOS 15 this code worked

#import "AppDelegate.h"
#import "MainViewController.h"
#import <AppTrackingTransparency/AppTrackingTransparency.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
    self.viewController = [[MainViewController alloc] init];
    if (@available(iOS 14, *)) {
        [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
            //If you want to do something with the pop-up
        }];
    }
    return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

@end

I dont really know why the event is not getting triggered. Best regards.

Replies

Did you check that the "Allow Apps to Request to Track" switch is on, on your iOS 15 device?

Yes it is on.

[[UNUserNotificationCenter currentNotificationCenter]
                     requestAuthorizationWithOptions:authOptions
                     completionHandler:^(BOOL granted, NSError * _Nullable error) {
                        @try {
                            DispatchQueue.main.asyncAfter(deadline: .now() + 1){
                                if (@available(iOS 14, *)) {
                                    [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
                                     //If you want to do something with the pop-up
                                    }];
                                    }
                            }

From other post i realized that if notifications permission is up, tracking pop up can get blocked. Ill try this.

applicationDidBecomeActive, requestTrackingAuthorizationWithCompletionHandler It's fine in iOS15,but iOS15.5 is can't. How did you resolved?