Open gabrielguilhoto opened 1 month ago
How to download sh required_reason_api_scanner.sh YourAppDirectory and run in your react-native project?
How to download sh required_reason_api_scanner.sh YourAppDirectory and run in your react-native project?
You can clone the https://github.com/Wooder/ios_17_required_reason_api_scanner repository to be able to run it.
@gabrielguilhoto - Thanks for your reply.
@gabrielguilhoto - After I cloned the git on my desktop.Getting error. sh required_reason_api_scanner.sh Desktop
sh: required_reason_api_scanner.sh: No such file or directory
@gabrielguilhoto - After I cloned the git on my desktop.Getting error. sh required_reason_api_scanner.sh Desktop
sh: required_reason_api_scanner.sh: No such file or directory
If you cloned it on your desktop then there is no folder called Desktop... you would just put .
...
@WilliamWelsh - Thanks it is working. Is it mandatory to update every library for iOS privacy manifest?
Yeah... should I mention it once again, #1197 — The future of react-native-fs? You probably should migrate to my fork of the lib, and file new issues, do any contributions in there.
I am using react-native-fs:2.20.0. Can I update this library for the iOS privacy manifest file?
I have no use for disk space APIs so I removed them with patch-package:
diff --git a/node_modules/react-native-fs/RNFSManager.m b/node_modules/react-native-fs/RNFSManager.m
index 5ddd941..80fb3e9 100755
--- a/node_modules/react-native-fs/RNFSManager.m
+++ b/node_modules/react-native-fs/RNFSManager.m
@@ -726,24 +726,11 @@ + (BOOL)requiresMainQueueSetup
{
unsigned long long totalSpace = 0;
unsigned long long totalFreeSpace = 0;
-
- __autoreleasing NSError *error = nil;
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
- NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error:&error];
-
- if (dictionary) {
- NSNumber *fileSystemSizeInBytes = [dictionary objectForKey: NSFileSystemSize];
- NSNumber *freeFileSystemSizeInBytes = [dictionary objectForKey:NSFileSystemFreeSize];
- totalSpace = [fileSystemSizeInBytes unsignedLongLongValue];
- totalFreeSpace = [freeFileSystemSizeInBytes unsignedLongLongValue];
-
- resolve(@{
- @"totalSpace": [NSNumber numberWithUnsignedLongLong:totalSpace],
- @"freeSpace": [NSNumber numberWithUnsignedLongLong:totalFreeSpace]
- });
- } else {
- [self reject:reject withError:error];
- }
+ // Remove disk space APIs to not to trigger NSPrivacyAccessedAPICategoryDiskSpace for privacy manifest
+ resolve(@{
+ @"totalSpace": [NSNumber numberWithUnsignedLongLong:totalSpace],
+ @"freeSpace": [NSNumber numberWithUnsignedLongLong:totalFreeSpace]
+ });
}
@gabrielguilhoto @gkasireddy202 Have You found any workaround for this or do we have to manually add the reason in PrivacyInfo.xcprivacy under this API Type NSPrivacyAccessedAPICategoryFileTimestamp.
Have You found any workaround for this or do we have to manually add the reason in PrivacyInfo.xcprivacy under this API Type NSPrivacyAccessedAPICategoryFileTimestamp.
I added this API reason in PrivacyInfo.xcprivacy file in my app.
@gkasireddy202 Under this API NSPrivacyAccessedAPICategoryFileTimestamp? Secondly after adding apple approved your app without any warnings? Kindly mention which reason you add
@MianSaad705 - I added the below API type and reason in my app privacy file.I did not get any warning emails from Apple and also app is approved.
@gkasireddy202 Thanks.
Starting May 1, Apple will require iOS submissions to the App Store to have privacy manifests describing the use of required reason APIs: https://developer.apple.com/news/?id=3d8a9yyh.
I used a script to find required reason APIs in our project and it pointed to 4 uses by
react-native-fs
in theRNFSManager.m
file, at least in version 2.19.0:NSFileCreationDate
NSFileModificationDate
NSFileSystemFreeSize
NSFileSystemSize
Could you please add the required privacy manifest?