You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And added it to the Podfile
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['ENABLE_BITCODE'] = 'NO'
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 13.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
end
But during runtime, it keeps returning returning PermissionStatus.patentlyDenied
Expected results
PermissionStatus.granted
Actual results
returning PermissionStatus.patentlyDenied
Code sample
static checkPermission(
{required List permissionList,
String? errMsg,
VoidCallback? onSuccess,
VoidCallback? onFailed,
VoidCallback? goSetting}) async {
List newPermissionList = [];
for (Permission permission in permissionList) {
PermissionStatus status = await permission.status;
if (!status.isGranted) {
newPermissionList.add(permission);
}
}
if (newPermissionList.isNotEmpty) {
PermissionStatus permissionStatus =
await requestPermission(newPermissionList);
switch (permissionStatus) {
case PermissionStatus.denied:
onFailed != null ? onFailed() : defaultCall("message");
break;
case PermissionStatus.granted:
onSuccess != null ? onSuccess() : defaultCall("message");
break;
case PermissionStatus.restricted:
case PermissionStatus.limited:
case PermissionStatus.permanentlyDenied:
goSetting != null ? goSetting() : await openAppSettings();
break;
case PermissionStatus.provisional:
// TODO: Handle this case.
}
} else {
onSuccess != null ? onSuccess() : defaultCall("message");
}
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-arm64, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.96.0)
[✓] Connected device (4 available)
The text was updated successfully, but these errors were encountered:
Koenger
changed the title
[Bug]:
[Bug]: When mixing Flutter and iOS, use frameworks( https://docs.flutter.cn/add-to-app/ios/project-setup )Method integration
Dec 18, 2024
Please check the following before submitting a new issue.
Please select affected platform(s)
Steps to reproduce
When mixing Flutter and iOS, use frameworks( https://docs.flutter.cn/add-to-app/ios/project-setup )Method integration
Added to info. plist
NSBluetoothAlwaysUsageDescription
message
NSBluetoothPeripheralUsageDescription
message
NSCameraUsageDescription
message
NSLocationAlwaysAndWhenInUseUsageDescription
message
NSLocationAlwaysUsageDescription
message
NSLocationUsageDescription
message
NSLocationWhenInUseUsageDescription
message
NSMicrophoneUsageDescription
message
NSPhotoLibraryAddUsageDescription
message
NSPhotoLibraryUsageDescription
message
NSRemindersUsageDescription
message
NSUserTrackingUsageDescription
message
And added it to the Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
user_target_xcconfig.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.speech
#'PERMISSION_SPEECH_RECOGNIZER=1',
]
config.build_settings['ENABLE_BITCODE'] = 'NO'
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 13.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
end
But during runtime, it keeps returning returning PermissionStatus.patentlyDenied
Expected results
PermissionStatus.granted
Actual results
returning PermissionStatus.patentlyDenied
Code sample
static checkPermission(
{required List permissionList,
String? errMsg,
VoidCallback? onSuccess,
VoidCallback? onFailed,
VoidCallback? goSetting}) async {
List newPermissionList = [];
}
static Future requestPermission(
List permissionList) async {
Map<Permission, PermissionStatus> statuses = await permissionList.request();
PermissionStatus currentPermissionStatus = PermissionStatus.granted;
statuses.forEach((key, value) {
if (!value.isGranted) {
currentPermissionStatus = value;
return;
}
});
return currentPermissionStatus;
}
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
permission_handler: 11.3.1
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.22.3, on macOS 14.5 23F79 darwin-arm64, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.96.0)
[✓] Connected device (4 available)
The text was updated successfully, but these errors were encountered: