Hey everyone, I’m a bit confused. My app builds are going through, but Apple’s now giving me these weird warnings about missing API declarations. They’re talking about stuff like file timestamps, boot time, disk space, and user defaults.
Apparently, starting May 2024, we need to add some NSPrivacyAccessedAPITypes array to our privacy manifest. Has anyone else run into this? What’s the deal with these new privacy rules?
Here’s a snippet of what I’m seeing in my build warnings:
ITMS-91053: Missing API declaration
Your app's code in the 'MyApp' file uses APIs that need reasons:
- NSPrivacyAccessedAPICategoryFileTimestamp
- NSPrivacyAccessedAPICategorySystemBootTime
- NSPrivacyAccessedAPICategoryDiskSpace
- NSPrivacyAccessedAPICategoryUserDefaults
Do we really need to explain why we’re using these basic APIs? Seems like overkill to me. Any thoughts on how to handle this?
I’ve encountered this recently as well. It’s part of Apple’s ongoing push for increased privacy transparency. While it may seem excessive, they’re aiming to give users more insight into how apps use system resources and data.
To address this, you’ll need to create a privacy manifest file (privacy_manifest.json) in your project. In it, you’ll declare the APIs your app uses and provide justifications. For example:
{
"NSPrivacyAccessedAPICategoryFileTimestamp": "Used for file management and version control.",
"NSPrivacyAccessedAPICategorySystemBootTime": "Required for system diagnostics.",
"NSPrivacyAccessedAPICategoryDiskSpace": "Ensures sufficient storage for app functionality.",
"NSPrivacyAccessedAPICategoryUserDefaults": "Stores user preferences and settings."
}
It’s a bit of extra work, but it shouldn’t be too burdensome once you’ve set it up. Just make sure to keep it updated as your app evolves.
yeh, i’ve been dealing with this too. it’s a pain in the ass, but we gotta do it. basically, you need to make a privacy_manifest.json file and list out why ur using those APIs. like for file timestamps, say it’s for keeping track of file versions or whatever. it’s annoying but not too hard once u figure it out
I’ve been wrestling with this new Apple requirement too. It’s definitely a headache, but I’ve found a way to tackle it that’s worked pretty well for me. First off, don’t panic - it’s not as complicated as it seems at first glance.
What I did was create a privacy_manifest.json file in my project root. Then, I went through my code and identified where I was using each of these APIs. For file timestamps, I realized I was using it for caching mechanisms. For boot time, it was part of a diagnostic tool. Disk space checks were for ensuring enough storage for downloads.
The tricky part was explaining user defaults usage. I ended up breaking it down by feature, like ‘storing user preferences for dark mode’ and ‘remembering last used settings’.
Once you’ve got your reasons, just list them out in the JSON file. It took me about an hour to get it all sorted, but now my builds are sailing through without those warnings. Hope this helps!