Podfile 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")
  4. platform :ios, '13.0'
  5. require 'json'
  6. podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) rescue {}
  7. target 'cnpmobile' do
  8. use_frameworks!
  9. # Convert all permission pods into static libraries
  10. pod 'react-native-config', :path => '../node_modules/react-native-config'
  11. pod 'react-native-view-shot', :path => '../node_modules/react-native-view-shot'
  12. pre_install do |installer|
  13. Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  14. installer.pod_targets.each do |pod|
  15. if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
  16. def pod.build_type;
  17. # Uncomment the line corresponding to your CocoaPods version
  18. Pod::BuildType.static_library # >= 1.9
  19. # Pod::Target::BuildType.static_library # < 1.9
  20. end
  21. end
  22. end
  23. end
  24. use_expo_modules!
  25. config = use_native_modules!
  26. use_react_native!(
  27. :path => config[:reactNativePath],
  28. :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes'
  29. )
  30. # Uncomment to opt-in to using Flipper
  31. #
  32. # if !ENV['CI']
  33. # use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
  34. # end
  35. post_install do |installer|
  36. react_native_post_install(installer)
  37. installer.pods_project.targets.each do |target|
  38. target.build_configurations.each do |config|
  39. if Gem::Version.new('8.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
  40. config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
  41. end
  42. end
  43. end
  44. # __apply_Xcode_12_5_M1_post_install_workaround(installer)
  45. # This is necessary for Xcode 14, because it signs resource bundles by default
  46. # when building for devices.
  47. installer.target_installation_results.pod_target_installation_results
  48. .each do |pod_name, target_installation_result|
  49. target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
  50. resource_bundle_target.build_configurations.each do |config|
  51. config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
  52. end
  53. end
  54. end
  55. # Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
  56. # Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
  57. installer.pods_project.targets.each do |target|
  58. if (target.name&.eql?('FBReactNativeSpec'))
  59. target.build_phases.each do |build_phase|
  60. if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
  61. target.build_phases.move(build_phase, 0)
  62. end
  63. end
  64. end
  65. end
  66. end
  67. permissions_path = '../node_modules/react-native-permissions/ios'
  68. pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  69. pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  70. pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  71. pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  72. pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  73. pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
  74. pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
  75. pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
  76. end