Podfile 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. # Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
  38. # Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
  39. installer.pods_project.targets.each do |target|
  40. if (target.name&.eql?('FBReactNativeSpec'))
  41. target.build_phases.each do |build_phase|
  42. if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
  43. target.build_phases.move(build_phase, 0)
  44. end
  45. end
  46. end
  47. target.build_configurations.each do |config|
  48. config.build_settings['ENABLE_BITCODE'] = 'NO'
  49. end
  50. end
  51. end
  52. permissions_path = '../node_modules/react-native-permissions/ios'
  53. pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  54. pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  55. pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  56. pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  57. pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  58. pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
  59. pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
  60. pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
  61. end