Podfile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
  2. require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
  3. require 'json'
  4. podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
  5. def ccache_enabled?(podfile_properties)
  6. # Environment variable takes precedence
  7. return ENV['USE_CCACHE'] == '1' if ENV['USE_CCACHE']
  8. # Fall back to Podfile properties
  9. podfile_properties['apple.ccacheEnabled'] == 'true'
  10. end
  11. ENV['RCT_NEW_ARCH_ENABLED'] ||= '0' if podfile_properties['newArchEnabled'] == 'false'
  12. ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] ||= podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
  13. ENV['RCT_USE_RN_DEP'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
  14. ENV['RCT_USE_PREBUILT_RNCORE'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
  15. platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
  16. prepare_react_native_project!
  17. target 'unamobileapp' do
  18. use_expo_modules!
  19. if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
  20. config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
  21. else
  22. config_command = [
  23. 'npx',
  24. 'expo-modules-autolinking',
  25. 'react-native-config',
  26. '--json',
  27. '--platform',
  28. 'ios'
  29. ]
  30. end
  31. config = use_native_modules!(config_command)
  32. use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  33. use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
  34. use_react_native!(
  35. :path => config[:reactNativePath],
  36. :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
  37. # An absolute path to your application root.
  38. :app_path => "#{Pod::Config.instance.installation_root}/..",
  39. :privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
  40. )
  41. post_install do |installer|
  42. react_native_post_install(
  43. installer,
  44. config[:reactNativePath],
  45. :mac_catalyst_enabled => false,
  46. :ccache_enabled => ccache_enabled?(podfile_properties),
  47. )
  48. end
  49. end
  50. target 'OneSignalNotificationServiceExtension' do
  51. pod 'OneSignalXCFramework', '>= 5.0', '< 6.0'
  52. use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  53. end