Search code examples
iosobjective-cswiftadmob

iOS 14 requestTrackingAuthorization status always denied


I'm trying to prepare my app for Admob ios 14, I read this article:

https://developers.google.com/admob/ios/ios14

And I did everything they wrote down, but when I run this command:

func requestIDFA() {
    if #available(iOS 14, *) {
        ATTrackingManager.requestTrackingAuthorization(completionHandler: { [self] status in
            loadAdMob()
        })
    } else {
        loadAdMob()
    }
}

status is always denied and no popup message is showing.

I approve the:

  1. Allow apps to request to track
  2. Personalized ads

flags in the settings app.

I also tried to delete the app but still the same issue, any idea what is the problem?

EDIT: Tracking settings screen:

enter image description here


Solution

  • The thing that finally worked for me was a "General->Reset->Reset All Content and Settings".

    Then when I installed my app the prompt appeared and I could select to Allow tracking. Afterwards my app appeared in Settings, which it had not before, and on tapping it there's an option to disable/enable tracking. The app also now appears in Privacy/Tracking, which it did not before.

    I tested further by deleting the app and reinstalling, and again it showed the message to allow tracking.

    The only reason I can think ATT does not work as expected is that all apps installed prior to iOS 14.4 / ATT are assumed to be set to "do not allow tracking," but the OS misses adding the app to the Settings page so there's no way of changing it. Although, this does not explain why an uninstall/reinstall of the app still doesn't work.

    In conclusion, creating a fresh app might work (untested), but factory reset definitely does work.