Missing an expected key: 'NSPrivacyCollectedDataTypes'
Asked Answered
C

2

8

I got the issue in my Policies I don't know why? Even I follow all Instruction that apple provide on their official Page. But could not find any solution here.

I also followed ITMS-91053: Missing API declaration - Privacy on StackOverflow

Here is my PrivacyInfo.xcprivacy file

enter image description here

I download the Privacy Report I shows me that error enter image description here

Consist answered 26/3 at 6:25 Comment(3)
The error message is very clear about what you should do - add a 'NSPrivacyCollectedDataTypes' key to your privacy manifest. Did you try doing that?Pollerd
Yes I add the Key " <key>NSPrivacyCollectedDataTypes</key>" It still give me same error.Consist
Perhaps the PrivacyInfo.xcprivacy file is missing from a third-party framework or library that's included in your project? I got an error message that NSPrivacyCollectedDataTypes is missing from "MyApp.app/Frameworks/PSPDFKit.framework/PrivacyInfo.xcprivacy". That library has not yet been updated with this privacy info.Advertising
S
8

As the attached photo, your NSPrivacyCollectedDataTypes was empty. You need to provide at least one data type, which is listed here. i.e, You're collecting user email for advertising purpose, it's should be something like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSPrivacyCollectedDataTypes</key>
    <array>
        <dict>
            <key>NSPrivacyCollectedDataType</key>
            <string>NSPrivacyCollectedDataTypeEmailAddress</string>
            <key>NSPrivacyCollectedDataTypeLinked</key>
            <false/>
            <key>NSPrivacyCollectedDataTypeTracking</key>
            <false/>
            <key>NSPrivacyCollectedDataTypePurposes</key>
            <array>
                <string>NSPrivacyCollectedDataTypePurposeDeveloperAdvertising</string>
            </array>
        </dict>
    </array>
</dict>
</plist>

enter image description here

Sethrida answered 26/3 at 6:52 Comment(0)
G
2

Add the NSPrivacyCollectedDataTypes to your PrivacyInfo.xcprivacy file with an empty array.

PrivacyInfo.xcprivacy

Gilead answered 3/5 at 8:50 Comment(2)
Hi! i've a similar problem: my app doesn't use any url with privacay collected data types by some of my pods do. Can I just add an empty array and xcode will merge?Onwards
Looks like adding an empty array does the job.Alwitt

© 2022 - 2024 — McMap. All rights reserved.