ATT Permission Request Prompt Bug on Real iOS Device
One of my apps was rejected due to an AppTrackingTransparency (ATT) Permission issue.
This was weird because all my apps adhere to the same policy.
In the review memo, I explained where the ATT Permission request prompt is presented, as one app was rejected for this reason.
Surprisingly, there were no further rejections. So, why was it suddenly rejected?
Upon investigation, I discovered that I had implemented ATT to appear after the user had viewed three ads. To ensure everything was working correctly, I tested the app on my real device. However, even after launching the app three times, I couldn’t see the ATT prompt.
Determined to find the issue, I began debugging line by line.
ATTrackingManager.requestTrackingAuthorization { status in
switch status {
case .authorized:
And I found the bug: requestTrackAuthorization
always returns authorized
. I googled for more information about it.
applicationDidBecomeActive
Many people mentioned that the App State should be active when presenting the prompt, or they suggested giving a delay before presenting the prompt.
However, I had already called requestTrackAuthorization
under applicationDidBecomeActive
. Some people mentioned that the bug occurred only on real devices.
So I tested it on a simulator, and finally, I saw the prompt.
According to the discussion reinstalling couldn’t fix it.
Settings
I experimented with switching the Tracking setting. I turned off Tracking for my app, and requestTrackAuthorization returned denied
, even after reinstalling.
This is very weird… because the official document says
The system remembers the user’s choice and doesn’t prompt again unless a user uninstalls and then reinstalls the app on the device.
I uninstalled and reinstalled but why??
Some people recommend ‘Reset All Content and settings’. Terrible! I don’t like that.
OS Upgrading
My iOS was 16.3.1, so I upgraded it.
Now the ATT prompt is working very well even after reinstalling. Maybe it was an OS bug.
I checked all release notes from 16.3 to 17.4. However I couldn’t find anything about App Tracking..
If you found any help in this post, please give it a round of applause 👏. Explore more iOS-related content in my other posts.