frw / react-native-ssl-public-key-pinning

Simple and secure SSL public key pinning for React Native. No native configuration needed, set up in <5 minutes.
MIT License
163 stars 13 forks source link

Patch for error: file: undefined local variable or method `min_ios_version_supported' for Pod:Module #373

Closed DevangMstryls closed 2 weeks ago

DevangMstryls commented 1 month ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-ssl-public-key-pinning@1.2.4 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-ssl-public-key-pinning/react-native-ssl-public-key-pinning.podspec b/node_modules/react-native-ssl-public-key-pinning/react-native-ssl-public-key-pinning.podspec
index bd5e377..443fe41 100644
--- a/node_modules/react-native-ssl-public-key-pinning/react-native-ssl-public-key-pinning.podspec
+++ b/node_modules/react-native-ssl-public-key-pinning/react-native-ssl-public-key-pinning.podspec
@@ -3,6 +3,8 @@ require "json"
 package = JSON.parse(File.read(File.join(__dir__, "package.json")))
 folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'

+min_ios_version_supported = '13.0'
+
 Pod::Spec.new do |s|
   s.name         = "react-native-ssl-public-key-pinning"
   s.version      = package["version"]

This issue body was partially generated by patch-package.

frw commented 1 month ago

Hi @DevangMstryls,

Thanks for reporting the issue you're facing. Could I get more information on this? What react-native version are you using and how does your Podfile look like? Does your Podfile include react_native_pods.rb which contains the min_ios_version_supported variable and have the line platform :ios, min_ios_version_supported, like the following example project:

https://github.com/frw/react-native-ssl-public-key-pinning/blob/main/example/ios/Podfile#L8

I'm afraid that adding in a min_ios_version_supported in the library itself might break backwards compatibility with older React Native versions.

frw commented 2 weeks ago

Closing this due to inactivity. I have not been able to reproduce this, please check out the example project to see if there's an issue with your setup.