I'm on finish with my app and recently I send it on review for AppStore. I received message about App Tracking Transparency. So i tried to implement below code in my app but dialog pop-up dont show. Please help.
import Foundation
import AppTrackingTransparency
import AdSupport
class AppTrackingManager {
static func requestPermission() {
guard #available(iOS 14, *) else { return }
ATTrackingManager.requestTrackingAuthorization { status in
DispatchQueue.main.async {
switch status {
case .authorized:
// Tracking authorization dialog was shown
// and we are authorized
QonversionManager.setAdvId()
print(ASIdentifierManager.shared().advertisingIdentifier)
print("ATT: Authorized")
// Now that we are authorized we can get the I
case .denied:
// Tracking authorization dialog was
// shown and permission is denied
print("ATT: Denied")
case .notDetermined:
// Tracking authorization dialog has not been shown
print("ATT: Not Determined")
case .restricted:
print("ATT: Restricted")
@unknown default:
print("ATT: Unknown")
}
}
}
}
}
So i've created class for tracking and then i calling this func in my didFinishLaunch method in AppDelegate but nothing happens. Also i have this parameter in Info.plist
Solution: I moved the request function into initial view controller