Not working ATTrackingManager.requestTrackingAuthorization callback on 17.4

Environment:

  • Xcode Version: 15.3 (15E204a)
  • SDK Runtime: iOS 17.4 (17.4 - 21E213) - com.apple.CoreSimulator.SimRuntime.iOS-17-4

Issue:

When calling requestTrackingAuthorization of ATTrackingManager, the completionHandler is immediately called with a value of notDetermined.

This behavior is consistent even with async methods used in Runtime 14.0 and above.

Post not yet marked as solved Up vote post of koo1993 Down vote post of koo1993
1k views

Replies

My app update was also rejected because of this.

Add a Comment

My app update was also rejected because of this. Is there any solution ?

I reverted back to Xcode 15.2 (17.2) from 15.3 (17.4) using https://www.xcodes.app/ and it now works as expected again.

A workaround is to call the async version of the function like this:

Task {
  let result = await ATTrackingManager.requestTrackingAuthorization()
  // ...
}

Because it looks like they broke only the function with completion handler:

ATTrackingManager.requestTrackingAuthorization(completionHandler: { _ in })
  • import AppTrackingTransparency
    
    class ViewController: UIViewController {
        override func viewDidAppear(_ animated: Bool) {
            super.viewDidAppear(animated)
            
            if #available(iOS 14, *) {
                Task {
                    let state = await ATTrackingManager.requestTrackingAuthorization()
                    print(state.rawValue)
                }
            }
        }
    }
    

    I tried this code on the same environment. but it didn't work. What is your test environment?

  • I have 3 iOS apps and tested on iOS 17.4 (simulator and real device as well). I actually already published new versions for each of my app with async call and in my case it worked perfectly. But the synced version of the request is denied immediately.

    I invoke ATTrackingManager.requestTrackingAuthorization in AppDelegate's applicationDidBecomeActive(_ application: UIApplication) function.

Add a Comment

I'm encountering the same issue on 17.4

Tried the async await version and same issue, immediately responds with denied before user chooses allow / deny.