diff --git a/packages/react-native/scripts/cocoapods/helpers.rb b/packages/react-native/scripts/cocoapods/helpers.rb index 03e3a5cbeac67c..e4bfafa52af04f 100644 --- a/packages/react-native/scripts/cocoapods/helpers.rb +++ b/packages/react-native/scripts/cocoapods/helpers.rb @@ -26,3 +26,11 @@ def self.find_codegen_file(path) return `find #{path} -type f \\( #{js_files} -or #{ts_files} \\)`.split("\n").sort() end end + +module Helpers + class Constants + def self.min_ios_version_supported + return '13.4' + end + end +end diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 06f345aa80fef4..d88d2277e20e5c 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -281,6 +281,37 @@ def self.update_search_paths(installer) end end + def self.updateIphoneOSDeploymentTarget(installer) + pod_to_update = Set.new([ + "boost", + "CocoaAsyncSocket", + "Flipper", + "Flipper-DoubleConversion", + "Flipper-Fmt", + "Flipper-Boost-iOSX", + "Flipper-Folly", + "Flipper-Glog", + "Flipper-PeerTalk", + "FlipperKit", + "fmt", + "libevent", + "OpenSSL-Universal", + "RCT-Folly", + "SocketRocket", + "YogaKit" + ]) + + installer.target_installation_results.pod_target_installation_results + .each do |pod_name, target_installation_result| + unless pod_to_update.include?(pod_name) + next + end + target_installation_result.native_target.build_configurations.each do |config| + config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported + end + end + end + # ========= # # Utilities # # ========= # diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 6bded1d2838974..63cc802e465dbc 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -16,6 +16,7 @@ require_relative './cocoapods/new_architecture.rb' require_relative './cocoapods/local_podspec_patch.rb' require_relative './cocoapods/runtime.rb' +require_relative './cocoapods/helpers.rb' $CODEGEN_OUTPUT_DIR = 'build/generated/ios' $CODEGEN_COMPONENT_DIR = 'react/renderer/components' @@ -37,7 +38,7 @@ def min_ios_version_supported - return '13.4' + return Helpers::Constants.min_ios_version_supported end # This function returns the min supported OS versions supported by React Native @@ -272,10 +273,12 @@ def react_native_post_install( ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled) ReactNativePodsUtils.apply_xcode_15_patch(installer) ReactNativePodsUtils.apply_ats_config(installer) + ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer) NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer) NewArchitectureHelper.modify_flags_for_new_architecture(installer, NewArchitectureHelper.new_arch_enabled) + Pod::UI.puts "Pod install took #{Time.now.to_i - $START_TIME} [s] to run".green end