From 3e199bfe3eda15b06e9654c787845d814bae595a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A8=E3=83=AA=E3=82=B9?= Date: Wed, 17 Apr 2024 12:39:48 +0900 Subject: [PATCH] feat(ios): add bundled resources for privacy manifest (#193) --- README.md | 45 +++++++++++++++++++ plugin.xml | 2 + .../CDVDevice.bundle/PrivacyInfo.xcprivacy | 41 +++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 src/ios/CDVDevice.bundle/PrivacyInfo.xcprivacy diff --git a/README.md b/README.md index 89bf544a..48a1848b 100644 --- a/README.md +++ b/README.md @@ -305,3 +305,48 @@ var boolean = device.isiOSAppOnMac; ### Supported Platforms - iOS + +--- + +## iOS Privacy Manifest + +As of May 1, 2024, Apple requires a privacy manifest file to be created for apps and third-party SDKs. The purpose of the privacy manifest file is to explain the data being collected and the reasons for the required APIs it uses. Starting with `cordova-ios@7.1.0`, APIs are available for configuring the privacy manifest file from `config.xml`. + +This plugin comes pre-bundled with a `PrivacyInfo.xcprivacy` file that contains the list of APIs it uses and the reasons for using them. + +However, as an app developer, it will be your responsibility to identify additional information explaining what your app does with that data. + +In this case, you will need to review the "[Describing data use in privacy manifests](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests)" to understand the list of known `NSPrivacyCollectedDataTypes` and `NSPrivacyCollectedDataTypePurposes`. + +For example, if you collected the device ID for app functionality and analytics, you would write the following in `config.xml`: + +```xml + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeDeviceID + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAnalytics + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + + +``` + +Also, ensure all four keys—`NSPrivacyTracking`, `NSPrivacyTrackingDomains`, `NSPrivacyAccessedAPITypes`, and `NSPrivacyCollectedDataTypes`—are defined, even if you are not making an addition to the other items. Apple requires all to be defined. diff --git a/plugin.xml b/plugin.xml index 7afdd9fe..14a193ae 100644 --- a/plugin.xml +++ b/plugin.xml @@ -59,6 +59,8 @@ + + diff --git a/src/ios/CDVDevice.bundle/PrivacyInfo.xcprivacy b/src/ios/CDVDevice.bundle/PrivacyInfo.xcprivacy new file mode 100644 index 00000000..72852787 --- /dev/null +++ b/src/ios/CDVDevice.bundle/PrivacyInfo.xcprivacy @@ -0,0 +1,41 @@ + + + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + + NSPrivacyCollectedDataTypes + + +