From 616d81716c1ff1623176772935e0fbc95c7ac5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E5=9B=BD=E7=A5=A5?= Date: Thu, 3 Jul 2025 15:55:24 +0800 Subject: [PATCH] docs(README): Update the correspondence between permission groups and the key values of Info.plist - The correspondence table between permission groups and Info.plist key values has been updated in the README file - Several new mapping relationships for permission groups have been added, including sensors, bluetooth, appTrackingTransparency, criticalAlerts, and assistant - Corrected the macro definitions of some permission groups --- permission_handler/README.md | 41 +++++++++++--------- permission_handler_apple/example/ios/Podfile | 2 +- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/permission_handler/README.md b/permission_handler/README.md index cf268e369..836bd1339 100644 --- a/permission_handler/README.md +++ b/permission_handler/README.md @@ -127,7 +127,7 @@ You must list the permission you want to use in your application: ## dart: PermissionGroup.criticalAlerts 'PERMISSION_CRITICAL_ALERTS=1', - ## dart: PermissionGroup.criticalAlerts + ## dart: PermissionGroup.assistant 'PERMISSION_ASSISTANT=1', ] @@ -147,23 +147,28 @@ You must list the permission you want to use in your application: e.g. when you don't need camera permission, just delete 'NSCameraUsageDescription' The following lists the relationship between `Permission` and `The key of Info.plist`: -| Permission | Info.plist | Macro | -|---------------------------------------------------------------------------------------------| ------------------------------------------------------------------------------------------------------------- | ------------------------------------ | -| PermissionGroup.calendar (< iOS 17) | NSCalendarsUsageDescription | PERMISSION_EVENTS | -| PermissionGroup.calendarWriteOnly (iOS 17+) | NSCalendarsWriteOnlyAccessUsageDescription | PERMISSION_EVENTS | -| PermissionGroup.calendarFullAccess (iOS 17+) | NSCalendarsFullAccessUsageDescription | PERMISSION_EVENTS_FULL_ACCESS | -| PermissionGroup.reminders | NSRemindersUsageDescription | PERMISSION_REMINDERS | -| PermissionGroup.contacts | NSContactsUsageDescription | PERMISSION_CONTACTS | -| PermissionGroup.camera | NSCameraUsageDescription | PERMISSION_CAMERA | -| PermissionGroup.microphone | NSMicrophoneUsageDescription | PERMISSION_MICROPHONE | -| PermissionGroup.speech | NSSpeechRecognitionUsageDescription | PERMISSION_SPEECH_RECOGNIZER | -| PermissionGroup.photos | NSPhotoLibraryUsageDescription | PERMISSION_PHOTOS | -| PermissionGroup.photosAddOnly | NSPhotoLibraryAddUsageDescription | PERMISSION_PHOTOS_ADD_ONLY | -| PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse | NSLocationUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription | PERMISSION_LOCATION | -| PermissionGroup.locationWhenInUse | NSLocationWhenInUseUsageDescription | PERMISSION_LOCATION_WHENINUSE | -| PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS | -| PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMedia | -PERMISSION_MEDIA_LIBRARY | +| Permission | Info.plist | Macro | +|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|----------------------------------------| +| PermissionGroup.calendar (< iOS 17) | NSCalendarsUsageDescription | PERMISSION_EVENTS | +| PermissionGroup.calendarWriteOnly (iOS 17+) | NSCalendarsWriteOnlyAccessUsageDescription | PERMISSION_EVENTS | +| PermissionGroup.calendarFullAccess (iOS 17+) | NSCalendarsFullAccessUsageDescription | PERMISSION_EVENTS_FULL_ACCESS | +| PermissionGroup.reminders | NSRemindersUsageDescription | PERMISSION_REMINDERS | +| PermissionGroup.contacts | NSContactsUsageDescription | PERMISSION_CONTACTS | +| PermissionGroup.camera | NSCameraUsageDescription | PERMISSION_CAMERA | +| PermissionGroup.microphone | NSMicrophoneUsageDescription | PERMISSION_MICROPHONE | +| PermissionGroup.speech | NSSpeechRecognitionUsageDescription | PERMISSION_SPEECH_RECOGNIZER | +| PermissionGroup.photos | NSPhotoLibraryUsageDescription | PERMISSION_PHOTOS | +| PermissionGroup.photosAddOnly | NSPhotoLibraryAddUsageDescription | PERMISSION_PHOTOS_ADD_ONLY | +| PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse | NSLocationUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription | PERMISSION_LOCATION | +| PermissionGroup.locationWhenInUse | NSLocationWhenInUseUsageDescription | PERMISSION_LOCATION_WHENINUSE | +| PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS | +| PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMedia | PERMISSION_MEDIA_LIBRARY | +| PermissionGroup.sensors | NSMotionUsageDescription | PermissionGroupSensors | +| PermissionGroup.bluetooth | NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription | PermissionGroupBluetooth | +| PermissionGroup.appTrackingTransparency | NSUserTrackingUsageDescription | PermissionGroupAppTrackingTransparency | +| PermissionGroup.criticalAlerts | UNAuthorizationOptionCriticalAlert | PermissionGroupCriticalAlerts | +| PermissionGroup.assistant | NSSiriUsageDescription | PermissionGroupAssistant | + 4. Clean & Rebuild diff --git a/permission_handler_apple/example/ios/Podfile b/permission_handler_apple/example/ios/Podfile index 797c20f55..bdbed18e3 100644 --- a/permission_handler_apple/example/ios/Podfile +++ b/permission_handler_apple/example/ios/Podfile @@ -95,7 +95,7 @@ post_install do |installer| ## dart: PermissionGroup.criticalAlerts 'PERMISSION_CRITICAL_ALERTS=1', - ## dart: PermissionGroup.criticalAlerts + ## dart: PermissionGroup.assistant 'PERMISSION_ASSISTANT=1', ]