Podfile 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
  40. end
  41. end
  42. # This is necessary for Xcode 14, because it signs resource bundles by default
  43. # when building for devices.
  44. installer.target_installation_results.pod_target_installation_results
  45. .each do |pod_name, target_installation_result|
  46. target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
  47. resource_bundle_target.build_configurations.each do |config|
  48. config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
  49. end
  50. end
  51. end
  52. # Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
  53. # Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
  54. installer.pods_project.targets.each do |target|
  55. if (target.name&.eql?('FBReactNativeSpec'))
  56. target.build_phases.each do |build_phase|
  57. if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
  58. target.build_phases.move(build_phase, 0)
  59. end
  60. end
  61. end
  62. end
  63. end
  64. permissions_path = '../node_modules/react-native-permissions/ios'
  65. pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  66. pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  67. pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  68. pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  69. pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  70. pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
  71. pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
  72. pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
  73. end