I've recently been working on converting an existing application from Ionic 1 to the latest version of Ionic.
After submitting my IPA file to the Apple App Store and passing all of the validation checks I was ready to submit the application for review when I received the following error warning in iTunes Connect:
Your app is using the Advertising Identifier (IDFA). You must either provide details about the IDFA usage or remove it from the app and submit your binary again.
Damn! This was news to me - I wasn't even aware that this had been enabled in my application.
Talk about an uninvited guest!
After a little time spent poking around Xcode and inspecting the app codebase I discovered the culprit....the Cordova Google Analytics plugin.
By default the plugin enabled the Advertising Identifier as some of its methods allow developers to leverage Advertising Features offered by Google Analytics such as Remarketing, Demographics & Interests reports.
Unfortunately, as I neither used or needed such features, this presented the very real possibility of my application being rejected by the App Store moderators.
Thankfully solving this was relatively simple.
Disabling the Advertising Identifier
Within my Ionic project I opened the following file: plugins/cordova-plugin-google-analytics/plugin.xml and simply commented out the following lines:
<framework src="AdSupport.framework" /> <source-file src="ios/libAdIdAccess.a" framework="true" />
Within Xcode I then selected project TARGETS and under the General tab scrolled down to the Linked Frameworks and Libraries section.
Here I simply removed the following libraries and frameworks from those that were enabled:
Which, upon removal, now resembled the following:
After much testing (as, let's face it, I didn't know whether my modifications were going to break anything in my application's behaviour or Xcode's subsequent validation/parsing of the application build) I was able to re-package and submit a new archive to the App Store which was then able to be submitted for review without triggering the IDFA detection warning.
Hopefully this will help any other Ionic/Cordova developers out there who may be experiencing a similar issue with such App Store warnings.
There's nothing more frustrating than having tested your app to the point of exhaustion, found no issues or errors in doing so, passed Xcode's validation checks, successfully submitted your archive to the Apple App Store and then being hit with the IDFA error warning.
Thankfully fixing this is relatively simple although it was a headache to initially figure out the root cause behind the warning.
FYI: I'm NOT a fan of modifying plugin code, even as basic as commenting out the lines in the plugin.xml file, as this may have the potential to lead to unexpected behaviour's elsewhere in the application. In this instance though such tweaks were both justified and harmless leaving my application able to be submitted for review.
I hope this proves useful to developers out there who may be wrestling with the same issue.
If you enjoyed what you've read here then please sign up to my mailing list and, if you haven't done so already, take a look at my e-book: Mastering Ionic for further information about troubleshooting errors when working with the Ionic Framework.