You can add this code to the PodFile and try again.
Don't forget to clean, pub get and pod install.
Remember just turn off the comment line for the properties you are using and set the value to 1.
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.calendar
##'PERMISSION_EVENTS=1',
## dart: PermissionGroup.reminders
#'PERMISSION_REMINDERS=0',
## dart: PermissionGroup.contacts
# 'PERMISSION_CONTACTS=0',
## dart: PermissionGroup.camera
'PERMISSION_CAMERA=1',
## dart: PermissionGroup.microphone
'PERMISSION_MICROPHONE=1',
## dart: PermissionGroup.speech
#'PERMISSION_SPEECH_RECOGNIZER=0'
## dart: PermissionGroup.photos
'PERMISSION_PHOTOS=1',
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
'PERMISSION_LOCATION=1',
## dart: PermissionGroup.notification
'PERMISSION_NOTIFICATIONS=1',
## dart: PermissionGroup.appTrackingTransparency
##'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
## dart: PermissionGroup.mediaLibrary
##'PERMISSION_MEDIA_LIBRARY=1'
## dart: PermissionGroup.sensors
#'PERMISSION_SENSORS=0'
]
end
end
end
My Photos and Camera permissions function code:
Future<bool?> _checkPermission(BuildContext context) async {
if (Platform.isAndroid) {
Map<Permission, PermissionStatus> statues = await [Permission.camera, Permission.photos].request();
PermissionStatus? statusCamera = statues[Permission.camera];
PermissionStatus? statusPhotos = statues[Permission.photos];
bool isGranted = statusCamera == PermissionStatus.granted && statusPhotos == PermissionStatus.granted;
if (isGranted) {
return true;
}
bool isPermanentlyDenied = statusCamera == PermissionStatus.permanentlyDenied || statusPhotos == PermissionStatus.permanentlyDenied;
if (isPermanentlyDenied) {
return false;
}
} else {
Map<Permission, PermissionStatus> statues = await [Permission.camera, Permission.storage, Permission.photos].request();
PermissionStatus? statusCamera = statues[Permission.camera];
PermissionStatus? statusStorage = statues[Permission.storage];
PermissionStatus? statusPhotos = statues[Permission.photos];
bool isGranted = statusCamera == PermissionStatus.granted && statusStorage == PermissionStatus.granted && statusPhotos == PermissionStatus.granted;
if (isGranted) {
return true;
}
bool isPermanentlyDenied = statusCamera == PermissionStatus.permanentlyDenied || statusStorage == PermissionStatus.permanentlyDenied || statusPhotos == PermissionStatus.permanentlyDenied;
if (isPermanentlyDenied) {
return false;
}
}
}