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?