add PERMISSION_PHOTOS in CocoaPods build configuration to use Permission.photos correctly on iOS

This commit is contained in:
Wenqi Li 2023-07-24 00:53:28 +08:00
parent 9f457f5e0a
commit 0141329350
2 changed files with 42 additions and 3 deletions

View File

@ -37,5 +37,44 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
# Here are some configurations automatically generated by flutter
# You can enable the permissions needed here. For example to enable camera
# permission, just remove the `#` character in front so it looks like this:
# ## dart: PermissionGroup.camera
# 'PERMISSION_CAMERA=1'
# Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.calendar
# 'PERMISSION_EVENTS=1',
## dart: PermissionGroup.reminders
# 'PERMISSION_REMINDERS=1',
## dart: PermissionGroup.contacts
# 'PERMISSION_CONTACTS=1',
## dart: PermissionGroup.camera
# 'PERMISSION_CAMERA=1',
## dart: PermissionGroup.microphone
# 'PERMISSION_MICROPHONE=1',
## dart: PermissionGroup.speech
# 'PERMISSION_SPEECH_RECOGNIZER=1',
## dart: PermissionGroup.photos
'PERMISSION_PHOTOS=1',
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
# 'PERMISSION_LOCATION=1',
## dart: PermissionGroup.notification
# 'PERMISSION_NOTIFICATIONS=1',
## dart: PermissionGroup.mediaLibrary
# 'PERMISSION_MEDIA_LIBRARY=1',
## dart: PermissionGroup.sensors
# 'PERMISSION_SENSORS=1',
## dart: PermissionGroup.bluetooth
# 'PERMISSION_BLUETOOTH=1',
## dart: PermissionGroup.appTrackingTransparency
# 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
## dart: PermissionGroup.criticalAlerts
# 'PERMISSION_CRITICAL_ALERTS=1'
]
end
end
end

View File

@ -1,6 +1,6 @@
PODS:
- Flutter (1.0.0)
- permission_handler_apple (9.1.0):
- permission_handler_apple (9.1.1):
- Flutter
- photo_gallery (0.0.1):
- Flutter
@ -25,10 +25,10 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
permission_handler_apple: 8f116445eff3c0e7c65ad60f5fef5490aa94b4e4
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
photo_gallery: 9f95e57747cd22c10676ece3660d1ffe6c603ee5
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
PODFILE CHECKSUM: 34ee0d615c11cc61efba04f55f35440fbdc98127
COCOAPODS: 1.12.1