1- # Resolve react_native_pods.rb com node para permitir hoisting
1+ # Resolve react_native_pods.rb com node para allow hoisting
22require Pod ::Executable . execute_command ( 'node' , [ '-p' ,
33 'require.resolve(
44 "react-native/scripts/react_native_pods.rb",
55 {paths: [process.argv[1]]},
66 )' , __dir__ ] ) . strip
77
8+ # ========================================
9+ # NEW ARCHITECTURE CONFIGURATION
10+ # ========================================
11+ # Change this value to control New Architecture:
12+ # true = Enable New Architecture (TurboModules + Fabric)
13+ # false = Use Legacy Architecture
14+ # ========================================
15+ $RCT_NEW_ARCH_ENABLED = false # ← CHANGE HERE: true ou false
16+
17+ # React Native environment setup
18+ ENV [ 'RCT_NEW_ARCH_ENABLED' ] = $RCT_NEW_ARCH_ENABLED ? '1' : '0'
19+
820platform :ios , '15.1'
921
1022use_frameworks! :linkage => :static
@@ -15,27 +27,46 @@ target 'sample' do
1527 use_react_native! (
1628 :path => config [ :reactNativePath ] ,
1729 :hermes_enabled => true ,
18- :fabric_enabled => false ,
19- :new_arch_enabled => false
30+ :fabric_enabled => $RCT_NEW_ARCH_ENABLED ,
31+ :new_arch_enabled => $RCT_NEW_ARCH_ENABLED ,
2032 )
2133
22- # Development: Use local SDK
23- pod 'react-native-usercentrics' , :path => '../..'
24-
25- # Testing: Use GitHub version (uncomment to test with published version)
26- # pod 'react-native-usercentrics', :git => 'https://github.com/Usercentrics/usercentrics-react-native.git', :tag => 'v2.22.2'
27-
2834 post_install do |installer |
2935 react_native_post_install (
3036 installer ,
37+ config [ :reactNativePath ] ,
3138 :mac_catalyst_enabled => false
3239 )
33-
40+
41+ # ========================================
42+ # APPLY NEW ARCHITECTURE CONFIGURATION
43+ # ========================================
3444 installer . pods_project . targets . each do |target |
3545 target . build_configurations . each do |config |
46+ # Apply New Architecture flags
47+ if $RCT_NEW_ARCH_ENABLED
48+ # Enable New Architecture (TurboModules + Fabric)
49+ config . build_settings [ 'RCT_NEW_ARCH_ENABLED' ] = '1'
50+ config . build_settings [ 'OTHER_CPLUSPLUSFLAGS' ] ||= [ '$(inherited)' ]
51+ config . build_settings [ 'OTHER_CPLUSPLUSFLAGS' ] << '-DRCT_NEW_ARCH_ENABLED=1'
52+ config . build_settings [ 'OTHER_CFLAGS' ] ||= [ '$(inherited)' ]
53+ config . build_settings [ 'OTHER_CFLAGS' ] << '-DRCT_NEW_ARCH_ENABLED=1'
54+ else
55+ # Use Legacy Architecture
56+ config . build_settings [ 'RCT_NEW_ARCH_ENABLED' ] = '0'
57+ end
58+
59+ # Fix modular headers issues
60+ config . build_settings [ 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' ] = 'YES'
61+ config . build_settings [ 'DEFINES_MODULE' ] = 'YES'
62+
63+ # Additional fixes for React Native 0.81
64+ config . build_settings [ 'GCC_WARN_INHIBIT_ALL_WARNINGS' ] = 'YES'
65+ config . build_settings [ 'CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER' ] = 'NO'
66+
67+ # C++ settings
3668 config . build_settings [ 'CLANG_CXX_LANGUAGE_STANDARD' ] = 'c++20'
3769 config . build_settings [ 'CLANG_CXX_LIBRARY' ] = 'libc++'
38- config . build_settings [ 'OTHER_CPLUSPLUSFLAGS' ] = '-std=c++20 -stdlib=libc++'
3970 end
4071 end
4172 end
0 commit comments