Podfile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. end
  48. end
  49. permissions_path = '../node_modules/react-native-permissions/ios'
  50. pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  51. pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  52. pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  53. pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  54. pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
  55. pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
  56. pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
  57. pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
  58. end