Podfile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. pre_install do |installer|
  12. Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
  13. installer.pod_targets.each do |pod|
  14. if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
  15. def pod.build_type;
  16. # Uncomment the line corresponding to your CocoaPods version
  17. Pod::BuildType.static_library # >= 1.9
  18. # Pod::Target::BuildType.static_library # < 1.9
  19. end
  20. end
  21. end
  22. end
  23. use_expo_modules!
  24. config = use_native_modules!
  25. use_react_native!(
  26. :path => config[:reactNativePath],
  27. :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes'
  28. )
  29. # Uncomment to opt-in to using Flipper
  30. #
  31. # if !ENV['CI']
  32. # use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
  33. # end
  34. post_install do |installer|
  35. react_native_post_install(installer)
  36. # Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
  37. # Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
  38. installer.pods_project.targets.each do |target|
  39. if (target.name&.eql?('FBReactNativeSpec'))
  40. target.build_phases.each do |build_phase|
  41. if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
  42. target.build_phases.move(build_phase, 0)
  43. end
  44. end
  45. end
  46. end
  47. end
  48. permissions_path = '../node_modules/react-native-permissions/ios'
  49. pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  50. pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  51. pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  52. pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  53. pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  54. pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
  55. pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
  56. pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
  57. end