Learn Apple’s Privacy Manifests
Apple has always been committed to providing transparency to its app users regarding the services and permissions of the applications they use.
When developing apps, we understand that a significant amount of user information is collected, whether we are aware of it or not.
The data is collected through various features such as registration, delivery, and payment, etc.
In some instances, third-party SDKs may be used to collect this data on our behalf.
[UPDATE — 17 April 2024] Finding out what privacy details have been captured in your existing project, is challenging.
Stelios Petrakis has published a Privacy Manifest CLI tool that parses an Xcode project/workspace or a Swift Package and attempts to locate calls to Apple’s required reason APIs and detect privacy collected data frameworks.
Starting March 13: A new or updated app to App Store Connect that uses an API requiring approved reasons, apple sends an email letting us know if we’re missing reasons in the app’s privacy manifest.
Starting May 1: Need to include approved reasons for the listed APIs used by your app’s code to upload a new or updated app to App Store Connect.
🙋♂️ What should I do as an application developer?
The app must include a declaration file containing sufficient information about the data collected by the app or third-party SDK, as well as the rationale behind it.
🙋♂️ Who should have the declaration file?
️ → Apps you distribute.
️ → SDKs you distribute.
→ SDKs app consuming in an application.
🙋♂️ Which? How? Where? to declaration
To ensure user privacy, we are creating a manifest file named ‘PrivacyInfo.xcprivacy’.
Step 1. Add new file: Choose File > New File.
Step 2. Search for Privacy: Scroll down to the Resource section, and select App Privacy File type.
Step 3. Select the Target: Check your app or third-party SDK’s target in the Targets list.
🙋♂️ What is PrivacyInfo.xcprivacy?
PrivacyInfo.xcprivacy file is a property list file, which has a key-value dictionary.
🙋♂️ Which keys are available and what is the purpose of each key?
- NSPrivacyTracking (Privacy Tracking Enabled): Boolean
It indicates whether the app or third-party SDK uses data for tracking as defined under the App Tracking Transparency framework.
⭕️ Sharing user or device data captured from our app like email, phone, addresses, location, etc. with data brokers.
⭕️ For targeted advertising, measurement, or other business purpose, user information is collected from our app & is combined with data from other companies’ apps, websites, or offline sources.
Business fulfils any of the above criteria set it to True.
2. NSPrivacyTrackingDomains (Privacy Tracking Domains): [Strings]
NSPrivacyTracking = true, the app must display a list of internet domains (At least one) that the app or third-party SDK connects to and engages in tracking.
3. NSPrivacyCollectedDataTypes (Privacy Nutrition Label Types): [Dictionary]
All apps must have this, regardless of its use for tracking data. Read, Describing data use in privacy manifests.
4. NSPrivacyAccessedAPITypes (Privacy Accessed API Types): [Dictionary]
In case, an application uses some specific API from the given category then it needs to list down them with reason.
NSPrivacyAccessedAPIType:
A string that identifies the category of required reason APIs your app uses.
NSPrivacyAccessedAPITypeReasons:
An array of strings that identifies the reasons your app uses the APIs.
- File TimeStamp API
- System Boot Time API
- Disk Space API
- Keyboard API
- UserDefaults:
Important: In the project, if you are using UserDefaults to save any information then you need to declare this NSPrivacyAccessedAPITypes
NSPrivacyAccessedAPIType: User Defaults
NSPrivacyAccessedAPITypeReasons : CA92.1: Access info from same app, per documentation
You can go through the Describing use of required reason API for other reasons or in-depth understanding of other use cases.
Let’s go through a few NSPrivacyCollectedDataType categories collected data types for more clearer understanding.
☎️ Contact Information:
🗺️ Location Information:
There are a few more categories and respective keys like,
🚴♀️ Health & Fitness, 💳 Financial Info, 🧍User Content, 👋 Browsing history, 🔍 Search history, 🪪 Identifiers, 💴 Purchases Info. 📈 Usage data, 👩⚕️ Diagnostics, 🌦️ Surroundings, 🧍♂️Body, and other data types.
You can see all the categories of data your app or third-party SDK collects.
How to decide what to add & when to add?
Case Study:
The application requires user information such as name, email, contact details, and location for app-specific functionality.
A privacy manifest looks like this:
Don't worry if you think manual keying in is not possible. The key-value pairs have a drop-down list to rescue the developers.
🙋♂️How to see if everything we provided is correct?
Create your app’s privacy report:
Step 1: Choose Product > Archive. Xcode creates the archive and reveals it in the organizer.
Step 2: Control-click the archive in the organizer and choose Generate Privacy Report.
Step 3: Choose a location to save the privacy report and DONE.
The report for above privacy will look like,
The million-dollar question is what when we are using some 3rd party SDK? How can an app developer know what user data is been captured and how it has been used?
Case Study:
In addition to the above case study we just have added the well-known third-party SDK Crashlytics.
App developers don’t have to take any action.
All the 3rd party SDK also has to comply with Apple’s privacy guidelines. This means 3rd party SDKs have/will have their privacy manifest. (PrivacyInfo.xcprivacy)
How to verify?
Add the Crashlytics SDK in our case and generate the privacy report by following the steps mentioned above.
The Diagnostics category is solely owned by the Crashlytics SDK.
I hope this article helps you to understand the privacy manifest, different categories, how to use it, and how to generate the report.