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:
Can someone tell me how I get a non-zero IDFA?
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
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" } }