Podfile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Uncomment this line to define a global platform for your project
  2. platform :ios, '10.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. end
  28. post_install do |installer|
  29. installer.pods_project.targets.each do |target|
  30. flutter_additional_ios_build_settings(target)
  31. target.build_configurations.each do |config|
  32. # You can remove unused permissions here
  33. # for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h
  34. # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
  35. config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
  36. '$(inherited)',
  37. ## dart: PermissionGroup.calendar
  38. 'PERMISSION_EVENTS=1',
  39. ## dart: PermissionGroup.reminders
  40. 'PERMISSION_REMINDERS=1',
  41. ## dart: PermissionGroup.contacts
  42. 'PERMISSION_CONTACTS=1',
  43. ## dart: PermissionGroup.camera
  44. 'PERMISSION_CAMERA=1',
  45. ## dart: PermissionGroup.microphone
  46. 'PERMISSION_MICROPHONE=1',
  47. ## dart: PermissionGroup.speech
  48. 'PERMISSION_SPEECH_RECOGNIZER=1',
  49. ## dart: PermissionGroup.photos
  50. 'PERMISSION_PHOTOS=1',
  51. ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
  52. 'PERMISSION_LOCATION=1',
  53. ## dart: PermissionGroup.notification
  54. 'PERMISSION_NOTIFICATIONS=1',
  55. ## dart: PermissionGroup.mediaLibrary
  56. 'PERMISSION_MEDIA_LIBRARY=1',
  57. ## dart: PermissionGroup.sensors
  58. 'PERMISSION_SENSORS=1',
  59. ## dart: PermissionGroup.bluetooth
  60. 'PERMISSION_BLUETOOTH=1',
  61. ## dart: PermissionGroup.appTrackingTransparency
  62. 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
  63. ## dart: PermissionGroup.criticalAlerts
  64. 'PERMISSION_CRITICAL_ALERTS=1',
  65. ]
  66. end
  67. end
  68. end