Podfile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # Uncomment this line to define a global platform for your project
  2. # platform :ios, '12.0'
  3. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
  4. ENV['COCOAPODS_DISABLE_STATS'] = 'true'
  5. project 'Runner', {
  6. 'Debug' => :debug,
  7. 'Profile' => :release,
  8. 'Release' => :release,
  9. }
  10. def flutter_root
  11. generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  12. unless File.exist?(generated_xcode_build_settings_path)
  13. raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  14. end
  15. File.foreach(generated_xcode_build_settings_path) do |line|
  16. matches = line.match(/FLUTTER_ROOT\=(.*)/)
  17. return matches[1].strip if matches
  18. end
  19. raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
  20. end
  21. require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
  22. flutter_ios_podfile_setup
  23. target 'Runner' do
  24. use_frameworks!
  25. use_modular_headers!
  26. flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  27. target 'RunnerTests' do
  28. inherit! :search_paths
  29. end
  30. end
  31. post_install do |installer|
  32. installer.pods_project.targets.each do |target|
  33. flutter_additional_ios_build_settings(target)
  34. target.build_configurations.each do |config|
  35. # You can remove unused permissions here
  36. # for more information: https://github.com/BaseflowIT/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h
  37. # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
  38. config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
  39. '$(inherited)',
  40. ## dart: PermissionGroup.calendar
  41. #'PERMISSION_EVENTS=1',
  42. ## dart: PermissionGroup.calendarFullAccess
  43. #'PERMISSION_EVENTS_FULL_ACCESS=1',
  44. ## dart: PermissionGroup.reminders
  45. #'PERMISSION_REMINDERS=1',
  46. ## dart: PermissionGroup.contacts
  47. #'PERMISSION_CONTACTS=1',
  48. ## dart: PermissionGroup.camera
  49. 'PERMISSION_CAMERA=1',
  50. ## dart: PermissionGroup.microphone
  51. #'PERMISSION_MICROPHONE=1',
  52. ## dart: PermissionGroup.speech
  53. #'PERMISSION_SPEECH_RECOGNIZER=1',
  54. ## dart: PermissionGroup.photos
  55. 'PERMISSION_PHOTOS=1',
  56. ## The 'PERMISSION_LOCATION' macro enables the `locationWhenInUse` and `locationAlways` permission. If
  57. ## the application only requires `locationWhenInUse`, only specify the `PERMISSION_LOCATION_WHENINUSE`
  58. ## macro.
  59. ##
  60. ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
  61. #'PERMISSION_LOCATION=1',
  62. #'PERMISSION_LOCATION_WHENINUSE=0',
  63. ## dart: PermissionGroup.notification
  64. #'PERMISSION_NOTIFICATIONS=1',
  65. ## dart: PermissionGroup.mediaLibrary
  66. #'PERMISSION_MEDIA_LIBRARY=1',
  67. ## dart: PermissionGroup.sensors
  68. #'PERMISSION_SENSORS=1',
  69. ## dart: PermissionGroup.bluetooth
  70. #'PERMISSION_BLUETOOTH=1',
  71. ## dart: PermissionGroup.appTrackingTransparency
  72. 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
  73. ## dart: PermissionGroup.criticalAlerts
  74. #'PERMISSION_CRITICAL_ALERTS=1',
  75. ## dart: PermissionGroup.criticalAlerts
  76. #'PERMISSION_ASSISTANT=1',
  77. ]
  78. end
  79. end
  80. end