TN3184: Adding data collection details to your privacy manifest
Declare the data your app or third-party SDK collects in a privacy manifest.
Overview
When you build an app or third-party SDK that collects any data type, perform these steps in your privacy manifest (PrivacyInfo.xcprivacy):
Add the
NSPrivacyCollectedDataTypeskey.For each data type your app or third-party SDK collects, add a dictionary as a value for the
NSPrivacyCollectedDataTypeskey. The dictionary includes the data type, the data linked to the user and tracking status, and a list of reasons for collecting this data type. For more information, see Add a collected data type and reasons dictionary.
For more information about the privacy manifest and these keys, see Privacy manifest files and Describing data use in privacy manifests.
This document describes how to add the NSPrivacyCollectedDataType, NSPrivacyCollectedDataTypeLinked, NSPrivacyCollectedDataTypeTracking, and NSPrivacyCollectedDataTypePurposes keys to your privacy manifest in Xcode. If you work outside of Xcode, review this document to learn about the expected structure of each key.
Add a collected data type key
The NSPrivacyCollectedDataType key uses the following format:
<key>NSPrivacyCollectedDataType</key>
<string>NS_PRIVACY_COLLECTED_DATA_TYPE_VALUE</string>The NS_PRIVACY_COLLECTED_DATA_TYPE_VALUE string specifies the type of data your app or third-party SDK collects. For possible values, see “Report the categories of data your app or third-party SDK collects“ in Describing data use in privacy manifests.
To add the NSPrivacyCollectedDataType key to a privacy collected data type and reasons dictionary in your privacy manifest:
Select the dictionary in the property list editor.
Click the disclosure triangle to the left of the dictionary to reveal it.
Click the Add button (+) beside the dictionary to add a new item.
In the pop-up menu, choose
NSPrivacyCollectedDataType.In the Type column, confirm that the value is
String.Select a data type from the pop-up menu in the Value column. For possible values, see “Report the categories of data your app or third-party SDK collects“ in Describing data use in privacy manifests.
Confirm that the value exactly matches the type of data your app or third-party SDK collects.
Add a collected data type linked key
The NSPrivacyCollectedDataTypeLinked key uses the following format:
<key>NSPrivacyCollectedDataTypeLinked</key>
<!-- Use <true/> if your app or third-party SDK links this data type to the user’s identity; otherwise,
use <false/>. -->
<true/>To add the NSPrivacyCollectedDataTypeLinked key to a privacy collected data type and reasons dictionary in your privacy manifest:
Select the dictionary in the property list editor.
Click the disclosure triangle to the left of the dictionary to reveal it.
Click the Add button (+) beside the dictionary to add a new item.
In the pop-up menu, choose
NSPrivacyCollectedDataTypeLinked.In the Type column, confirm that the value is
Boolean.Select
YESfrom the pop-up menu in the Value column if your app or third-party SDK links this data type to the user’s identity; otherwise, selectNO.
Add a collected data type tracking key
The NSPrivacyCollectedDataTypeTracking key uses the following format:
<key>NSPrivacyCollectedDataTypeTracking</key>
<!-- Use <true/> if your app or third-party SDK uses this data type to track; otherwise, use <false/>. -->
<true/>To add the NSPrivacyCollectedDataTypeTracking key to a privacy collected data type and reasons dictionary in your privacy manifest:
Select the dictionary in the property list editor.
Click the disclosure triangle to the left of the dictionary to reveal it.
Click the Add button (+) beside the dictionary to add a new item.
In the pop-up menu, choose
NSPrivacyCollectedDataTypeTracking.In the Type column, confirm that the value is
Boolean.Select
YESfrom the pop-up menu in the Value column if your app or third-party SDK uses this data type to track; otherwise, selectNO.
Add a collected data type purposes key
The NSPrivacyCollectedDataTypePurposes key uses the following format:
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NS_PRIVACY_COLLECTED_DATA_TYPE_PURPOSE_VALUE</string>
...
</array>Each NS_PRIVACY_COLLECTED_DATA_TYPE_PURPOSE_VALUE string in the array identifies a reason why your app or third-party SDK collects a data type. For possible values, see “Report the reasons your app or third-party SDK collects data” in Describing data use in privacy manifests.
To add the NSPrivacyCollectedDataTypePurposes key to a privacy collected data type and reasons dictionary in your privacy manifest:
Select the dictionary in the property list editor.
Click the disclosure triangle to the left of the dictionary to reveal it.
Confirm the dictionary contains a
NSPrivacyCollectedDataTypekey with a value as described in Add a collected data type key.Click the Add button (+) beside the dictionary to add a new item.
In the pop-up menu, choose
NSPrivacyCollectedDataTypePurposes.In the Type column, confirm that the value is
Array.Click the disclosure triangle to the left of
NSPrivacyCollectedDataTypePurposesto reveal it.Click the Add button (+) beside
NSPrivacyCollectedDataTypePurposesto add a reason.Choose a reason from the pop-up menu in the Value column. For possible values, see “Report the reasons your app or third-party SDK collects data” in Describing data use in privacy manifests.
Repeat the last two steps for each reason your app or third-party SDK collects this data type.
Add a collected data type and reasons dictionary
A privacy collected data type and reasons dictionary includes a data type, a data linked to the user status, a tracking status, and a list of reasons for collecting this data type. The dictionary contains exactly four keys: NSPrivacyCollectedDataType, NSPrivacyCollectedDataTypeLinked, NSPrivacyCollectedDataTypeTracking, and NSPrivacyCollectedDataTypePurposes. It uses the following format:
<dict>
<!-- Add a privacy collected data type key. -->
<key>NSPrivacyCollectedDataType</key>
<string>NS_PRIVACY_COLLECTED_DATA_TYPE_VALUE</string>
<!-- Add a privacy collected data type linked key. -->
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<!-- Add a privacy collected data type tracking key. -->
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<!-- Add a privacy collected data type purposes key. -->
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NS_PRIVACY_COLLECTED_DATA_TYPE_PURPOSE_VALUE</string>
...
</array>
</dict>To add a privacy collected data type and reasons dictionary to the NSPrivacyCollectedDataTypes key in your privacy manifest:
Select
PrivacyInfo.xcprivacyin the Project navigator in Xcode.Find the
NSPrivacyCollectedDataTypeskey in the property list editor.Click the disclosure triangle to the left of
NSPrivacyCollectedDataTypesto reveal it.Click the Add button (+) beside
NSPrivacyCollectedDataTypesto insert a new item.Confirm the value is
Dictionaryin the Type column.Click the disclosure triangle to the left of the dictionary to reveal it.
To add the
NSPrivacyCollectedDataTypekey to the dictionary, see Add a collected data type key.To add the
NSPrivacyCollectedDataTypeLinkedkey to the dictionary, see Add a collected data type linked key.To add the
NSPrivacyCollectedDataTypeTrackingkey to the dictionary, see Add a collected data type tracking key.To add the
NSPrivacyCollectedDataTypePurposeskey to the dictionary, see Add a collected data type purposes key.
Add the collected data types key
The NSPrivacyCollectedDataTypes key is an array of privacy collected data type and reasons dictionaries. For more information, see Add a collected data type and reasons dictionary. The key uses the following format:
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<!-- Add a privacy collected data type key. -->
<key>NSPrivacyCollectedDataType</key>
<string>NS_PRIVACY_COLLECTED_DATA_TYPE_VALUE</string>
<!-- Add a privacy collected data type linked key. -->
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<!-- Add a privacy collected data type tracking key. -->
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<!-- Add a privacy collected data type purposes key. -->
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NS_PRIVACY_COLLECTED_DATA_TYPE_PURPOSE_VALUE</string>
...
</array>
</dict>
...
</array>To add the NSPrivacyCollectedDataTypes key to your privacy manifest:
Select
PrivacyInfo.xcprivacyin the Project navigator.Click the Add button (+) beside the
App Privacy Configurationkey in the property list editor.In the pop-up menu that appears, choose
NSPrivacyCollectedDataTypes.Confirm the value is
Arrayin the Type column.To add a privacy collected data type and reasons dictionary, see Add a collected data type and reasons dictionary.
The following example declares the contacts information collected from the user in an app named Sample:
Repeat step 5 for each additional data type your app or third-party SDK collects. In the following example, Sample additionally collects user ID information from the user:
Revision History
2024-12-17 First published.
See Also
Latest
TN3205: Low-latency communication with RDMA over ThunderboltTN3206: Updating Apple Pay certificatesTN3179: Understanding local network privacyTN3190: USB audio device design considerationsTN3194: Handling account deletions and revoking tokens for Sign in with AppleTN3193: Managing the on-device foundation model’s context windowTN3115: Bluetooth State Restoration app relaunch rulesTN3192: Migrating your iPad app from the deprecated UIRequiresFullScreen keyTN3151: Choosing the right networking APITN3111: iOS Wi-Fi API overviewTN3191: IMAP extensions supported by Mail for iOS, iPadOS, and visionOSTN3134: Network Extension provider deploymentTN3189: Managing Mail background traffic loadTN3187: Migrating to the UIKit scene-based life cycleTN3188: Troubleshooting In-App Purchases availability in the App Store