I have been having a problem with implementing App Tracking Transparency. Everything works and the pop-up shows during the first launch, but for some reason Apple keeps rejecting it because I do not use App Tracking Transparency to request the user's permission before tracking their activity. I have even explained to them that I have implemented App Tracking Transparency and the pop-up shows at first-launch, but for some reason, there is still an issue.
Here is the code where I request App Tracking Transparency:
override func viewDidAppear(_ animated: Bool) {
if !didFinishSetup {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
fallthrough
case .denied:
fallthrough
case .restricted:
GADMobileAds.sharedInstance().start(completionHandler: nil)
self.mainGadBannerView.adUnitID = "ID"
self.mainGadBannerView.rootViewController = self
self.mainGadBannerView.load(GAMRequest())
case .notDetermined:
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
fallthrough
case .denied:
fallthrough
case .restricted:
GADMobileAds.sharedInstance().start(completionHandler: nil)
self.mainGadBannerView.adUnitID = "ID"
self.mainGadBannerView.rootViewController = self
self.mainGadBannerView.load(GAMRequest())
case .notDetermined:
break
@unknown default:
GADMobileAds.sharedInstance().start(completionHandler: nil)
self.mainGadBannerView.adUnitID = "ID"
self.mainGadBannerView.rootViewController = self
self.mainGadBannerView.load(GAMRequest())
}
}
@unknown default:
GADMobileAds.sharedInstance().start(completionHandler: nil)
self.mainGadBannerView.adUnitID = "ID"
self.mainGadBannerView.rootViewController = self
self.mainGadBannerView.load(GAMRequest())
}
}
}
didFinishSetup = true
}
}
It's pretty much an exact copy of the code except for the "ID" part and that's the only place where I make an ad request. Any ideas why the app is getting rejected even though the App Tracking Transparency pop-up still shows at first-launch?