Privacyinfo.xcprivacy doesn't work

I added this file as Apple requested due to my app using UserDefaults, but it still complains when I upload it.

This is the message: TMS-91053: Missing API declaration - Your app’s code in the “Production” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryUserDefaults.

And this is my file, what's wrong?

<plist version="1.0">

<dict>
    <key>NSPrivacyAccessedAPITypes</key>
    <array>
        <dict>
            <key>NSPrivacyAccessedAPIType</key>
            <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
            <key>NSPrivacyAccessedAPITypeReasons</key>
            <array>
                <string>CA92.1</string>
            </array>
        </dict>
    </array>
</dict>

</plist>

Replies

Do you use a library that could have more use cases of UserDefault ?

Your file seems OK as long as UserDefaults are used exclusively by this app (not apps from same group).

Maybe you could try to add some info to the String and see if it works:

<string>CA92.1 access user defaults to read and write information that is only accessible to the app itself</string>.

privacyInfo declaration is a really cryptic.

  • My app has two package dependencies, CBORCoding 1.3.2 and Half 1.3.1. I have no idea whether or not these packages use UserDefaults. I doubt that they do. How can I tell for sure?

  • I manage a number of other projects, some of which have more extensive dependencies. Am I understanding this wrong, or is it the case that unless every dependency I use is updated to include the correct API declaration, I won't be able to submit those apps anymore? What if the 3rd party does update their package but my app requires an older version of it?

  • Does the PrivacyInfo.xcprivacy file just need to be present in my project? Does it need to be in the bundle? Should it be listed under "Copy Bundle Resources"? Is there any other specific thing that iOS uses to determine that this is the file containing these declarations or is it just keyed to this filename?

Add a Comment

Requirement for 3rd party framework is not really clear…

See here: https://jochen-holzer.medium.com/embrace-the-evolution-preparing-your-ios-app-for-the-required-reason-api-38f2d12bbce5

3rd Party Libs Third-party SDKs need to provide their own privacy manifest files that record the types of data they collect. Your app’s privacy manifest file doesn’t need to cover data collected by third-party SDKs that your app links to.

Did CBORCoding 1.3.2 and Half 1.3.1. provide such manifest ?

Maybe you could ask to the author (same for both packages) : https://swiftpackageindex.com/SomeRandomiOSDev/CBORCoding. Author Joe Newton, somerandomiosdev @ gmail.com

  • I think I'm just missing something basic, like my manifest file is in the wrong location, or it isn't being added to the build correctly.

Add a Comment

I had to manually add the Privacy manifest file to the build under Build Phases -> Copy Bundle Resources. It would be nice if Xcode would do this automatically.