react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

Use of Apple's Required Reason apis requires privacy manifest

Open Rehubbard opened this issue 11 months ago • 11 comments

Apple is requiring packages and apps to declare their use of required reason apis. This library uses these apis that require a privacy manifest declaration: 1. NSFileModificationDate 2.NSUserDefaults

More info here: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api

Beginning May 1, 2024, Apple won't accept new apps or updates to existing apps that use packages that don't have a PrivacyInfo.xcprivacy.

Rehubbard avatar Mar 19 '24 17:03 Rehubbard

Also NSFileCreation date (along with NSFileModificationDate) are referenced in the SSZipArchive package, which appears to just be copy/pasted into the RNCP/ios folder. SSZipArchive's repo has been updated to comply as of last October (https://github.com/ZipArchive/ZipArchive/issues/687) but the version in this package needs to be updated.

hapablap21 avatar Apr 03 '24 15:04 hapablap21

Any update on this? ZipArchive released their update in 2.5.5

tdraper-dev avatar Apr 16 '24 14:04 tdraper-dev

Any update on this, folks? It's blocker after May 1 for release process

vomchik avatar Apr 17 '24 16:04 vomchik

Any update on this, folks? It's blocker after May 1 for release process

@vomchik FWIW, I've got a couple of deps in my application that may not be making it over the finish line in time / I don't want to risk waiting for, so my approach is to declare their API usage in my app's privacy manifest and pass in whatever reason they would have passed in.

I know that's technically counter to what Apple is requesting here, but in some circumstances there doesn't seem to be another choice.

tdraper-dev avatar Apr 17 '24 16:04 tdraper-dev

Would be good to have this manifest included until 1 of May...

MinskLeo avatar Apr 22 '24 14:04 MinskLeo

Any news on this?

julian-dotcom avatar Apr 25 '24 07:04 julian-dotcom

You can apply this patch.

https://www.npmjs.com/package/patch-package

diff --git a/node_modules/react-native-code-push/CodePush.podspec b/node_modules/react-native-code-push/CodePush.podspec
index d20c4f4..bee88a3 100644
--- a/node_modules/react-native-code-push/CodePush.podspec
+++ b/node_modules/react-native-code-push/CodePush.podspec
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
   # we explicitly let CocoaPods pull in the versions below so all dependencies are resolved and 
   # linked properly at a parent workspace level.
   s.dependency 'React-Core'
-  s.dependency 'SSZipArchive', '~> 2.2.2'
+  s.dependency 'SSZipArchive', '~> 2.5.5'
   s.dependency 'JWT', '~> 3.0.0-beta.12'
   s.dependency 'Base64', '~> 1.1'
 end
\ No newline at end of file

vomchik avatar Apr 25 '24 09:04 vomchik

You can apply this patch.

https://www.npmjs.com/package/patch-package

diff --git a/node_modules/react-native-code-push/CodePush.podspec b/node_modules/react-native-code-push/CodePush.podspec
index d20c4f4..bee88a3 100644
--- a/node_modules/react-native-code-push/CodePush.podspec
+++ b/node_modules/react-native-code-push/CodePush.podspec
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
   # we explicitly let CocoaPods pull in the versions below so all dependencies are resolved and 
   # linked properly at a parent workspace level.
   s.dependency 'React-Core'
-  s.dependency 'SSZipArchive', '~> 2.2.2'
+  s.dependency 'SSZipArchive', '~> 2.5.5'
   s.dependency 'JWT', '~> 3.0.0-beta.12'
   s.dependency 'Base64', '~> 1.1'
 end
\ No newline at end of file

Hi everyone, has anyone applied this patch yet? Did it work?

fxamauri avatar Apr 25 '24 18:04 fxamauri

I have tried this and I am getting error when I try to install pod

[!] CocoaPods could not find compatible versions for pod "SSZipArchive":
  In snapshot (Podfile.lock):
    SSZipArchive (= 2.2.3, ~> 2.2.2)

  In Podfile:
    CodePush (from `../node_modules/react-native-code-push`) was resolved to 8.2.2, which depends on
      SSZipArchive (~> 2.5.5)


You have either:
 * changed the constraints of dependency `SSZipArchive` inside your development pod `CodePush`.
   You should run `pod update SSZipArchive` to apply changes you've made.

When I try to update SSZipArchive, I get following issue

[!] CocoaPods could not find compatible versions for pod "SSZipArchive":
  In Podfile:
    CodePush (from `../node_modules/react-native-code-push`) was resolved to 8.2.2, which depends on
      SSZipArchive (~> 2.5.5)

Specs satisfying the `SSZipArchive (~> 2.5.5)` dependency were found, but they required a higher minimum deployment target.

I have tried to update minimum ios version to 15.5 by setting based on https://cocoapods.org/pods/SSZipArchive platform :ios, '15.5' in the Podfile without any luck.

Anyone has any luck.

bunnings-kamrul avatar May 15 '24 00:05 bunnings-kamrul

There are two places the minimum iOS version to 15.5 need to be updated, one in the local Podfile and also in the code-push podspec. Here is the updated podspec.

diff --git a/node_modules/react-native-code-push/CodePush.podspec b/node_modules/react-native-code-push/CodePush.podspec
index d20c4f4..6718c90 100644
--- a/node_modules/react-native-code-push/CodePush.podspec
+++ b/node_modules/react-native-code-push/CodePush.podspec
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
   s.license        = package['license']
   s.homepage       = package['homepage']
   s.source         = { :git => 'https://github.com/microsoft/react-native-code-push.git', :tag => "v#{s.version}"}
-  s.ios.deployment_target = '9.0'
+  s.ios.deployment_target = '15.5'
   s.tvos.deployment_target = '9.0'
   s.preserve_paths = '*.js'
   s.library        = 'z'
@@ -21,7 +21,7 @@ Pod::Spec.new do |s|
   # we explicitly let CocoaPods pull in the versions below so all dependencies are resolved and 
   # linked properly at a parent workspace level.
   s.dependency 'React-Core'
-  s.dependency 'SSZipArchive', '~> 2.2.2'
+  s.dependency 'SSZipArchive', '~> 2.5.5'
   s.dependency 'JWT', '~> 3.0.0-beta.12'
   s.dependency 'Base64', '~> 1.1'
 end

This got the package working for me at least.

bunnings-kamrul avatar May 15 '24 00:05 bunnings-kamrul

Hello, I would like to clarify whether the solution described above works for you? If it doesn’t, I recommend a temporary workaround: manually adding a Privacy Info file, similar to the one in the SSZipArchive package.

MikhailSuendukov avatar Jun 18 '24 17:06 MikhailSuendukov

@MikhailSuendukov Hello,

manually adding a Privacy Info file, similar to the one in the SSZipArchive package.

Should I copy and paste PrivacyInfo of ZipArchive to react-native-code-push and apply changes using patch-package?

ujeon avatar Aug 01 '24 02:08 ujeon

@ujeon Yes, you can try doing this as a temporary workaround.

MikhailSuendukov avatar Aug 05 '24 11:08 MikhailSuendukov

A fix for this issue was released with the AppCenter SDK ReactNative v9.0.0, so I'm closing this issue.

MikhailSuendukov avatar Sep 11 '24 11:09 MikhailSuendukov