My IDFA is all 0s. How do I get a unique IDFA?

I'm working on an app, and for Facebook Ads, to test the ads, you need to give Facebook your device's IDFA. I've tried to get my IDFA by writing this snippet (see bottom of post), and running it on my phone. My phone is running iOS 14.4

This program tells me my IDFA is "nothing". My current understanding is this means I've enabled some privacy setting that does this.

What I've tried:
  • Under Privacy > Apple Advertising, I turned on Personalized Ads.

  • Under Privacy > Tracking, I enabled Allow Apps to Request to Track

After doing this, I check my IDFA and it's still all 0s (00000000-0000-0000-0000-000000000000).

Can someone tell me how I get a non-zero IDFA?

Code Block
import SwiftUI
import AdSupport
struct ContentView: View {
    var body: some View {
        Text(identifierForAdvertising())
            .padding()
    }
}
struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
func identifierForAdvertising() -> String {
    // check if advertising tracking is enabled in user’s setting
    if ASIdentifierManager.shared().isAdvertisingTrackingEnabled {
        return ASIdentifierManager.shared().advertisingIdentifier.uuidString
    } else {
        return "nothing"
    }
}

Replies

You could try to use Branch-Device ID Finder this app, and see if it gives you a read of your IDFA?
Otherwise, I wonder if it is because before you updated to iOS14, you turned Limit Ad Tracking on and you inherited that status.