include NSPrivacyAccessedAPICategoryDiskSpace & NSPrivacyAccessedAPICategoryFileTimestamp Information🤔

Rmag Breaking News

Hey, so apple just came out of nowhere and sent a big email outlining something like NSPrivacyAccessedAPICategoryFileTimestamp Information, NSPrivacyAccessedAPICategoryDiskSpace and NSFileSystemFreeSize with few other API declaration.

Here’s what it means for you as a developer and here is what you can do.

How to release my current app😵‍💫

Don’t worry till May 1st, Apple doesn’t expect you to declare these. In fact, they would just flag the required API declaration and approve your app for now. So pushing to production won’t stop🥳

How do I get what are the declarations required before submission on Appstore?

You can run a bash script to check your codebase and dependencies for such API declaration requirements.

Use the following one:
https://github.com/Wooder/ios_17_required_reason_api_scanner/blob/main/required_reason_api_text_scanner.sh

Download the required_reason_api_scanner_text.sh file.

Go to terminal and go to the directory where this file was downloaded to. Run the following command with your app directory path.

sh required_reason_api_scanner.sh <AppDirectory>

This will give you a list of declarations, in the following format:

Found potentially required reason API usage ‘UserDefaults’
in ‘./ViewController.swift’ Line numbers: 128

Search for the API declarations mentioned here:

https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api

What’s next?

Go to Xcode (15 and above)
File -> New -> File
Search and select the ‘App privacy’ option
The default privacy file name is required, do not change that and continue
Copy the following file, and edit the newly created PrivacyInfo.xcprivacy:

<?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>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
</array>
</dict>
</plist>

You’re done!
Build your app, sit back and relax.⛱️

Leave a Reply

Your email address will not be published. Required fields are marked *