Skip to content

Instantly share code, notes, and snippets.

@romainbiard
Created May 6, 2024 12:51
Show Gist options
  • Save romainbiard/63004122fa9d87119380a7db973aea23 to your computer and use it in GitHub Desktop.
Save romainbiard/63004122fa9d87119380a7db973aea23 to your computer and use it in GitHub Desktop.
Script to fix Nielsen SDK privacy manifest issue
#!/bin/bash
PATCHED_NIELSEN_PRIVACY_MANIFEST="$PROJECT_DIR/Path/to/your/patched/PrivacyInfo.xcprivacy"
NIELSEN_PRIVACY_MANIFEST="$BUILD_DIR/../../SourcePackages/checkouts/nielsenappsdk-ios-dynamic-spm-global/products/NielsenAppApi.xcframework/ios-arm64/NielsenAppApi.framework/PrivacyInfo.xcprivacy"
NIELSEN_SIGNATURE_DIR="$BUILD_DIR/../../SourcePackages/checkouts/nielsenappsdk-ios-dynamic-spm-global/products/NielsenAppApi.xcframework/_CodeSignature"
if [ -f "$NIELSEN_PRIVACY_MANIFEST" ]; then
echo "Nielsen Privacy Manifest found at $NIELSEN_PRIVACY_MANIFEST, patching it with $PATCHED_NIELSEN_PRIVACY_MANIFEST"
chmod +rw "$NIELSEN_PRIVACY_MANIFEST"
cp "$PATCHED_NIELSEN_PRIVACY_MANIFEST" "$NIELSEN_PRIVACY_MANIFEST"
echo "Removing signature"
rm -Rf "$NIELSEN_SIGNATURE_DIR"
fi
<?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>NSPrivacyCollectedDataTypeDeviceID</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<true/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeProductInteraction</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
</array>
</dict>
</array>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>E174.1</string>
</array>
</dict>
</array>
<key>NSPrivacyTrackingDomains</key>
<array>
<string>www.nielsen.com</string>
</array>
<key>NSPrivacyTracking</key>
<true/>
</dict>
</plist>
@romainbiard
Copy link
Author

If you add this script as a build phase, it should work. FYI, leaving NSPrivacyTrackingDomains empty is forbidden when NSPrivacyTracking is set to true

@romainbiard
Copy link
Author

romainbiard commented May 6, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment