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 1/4] 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', ] From 4ab759edcea1521c7a83c1ad256578f04cb9b6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E5=9B=BD=E7=A5=A5?= Date: Sun, 6 Jul 2025 13:58:12 +0800 Subject: [PATCH 2/4] feat(docs): Update the permission request description and add new permission support - Updated the permission request description in Info.plist and added support for critical alert permissions - Updated the key correspondence table between permissions and Info.plist in README.md --- permission_handler/README.md | 42 +++++++++---------- .../example/ios/Runner/AppDelegate.swift | 2 +- .../example/ios/Runner/Info.plist | 4 ++ 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/permission_handler/README.md b/permission_handler/README.md index 836bd1339..67f5791d2 100644 --- a/permission_handler/README.md +++ b/permission_handler/README.md @@ -147,27 +147,27 @@ 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 | -| PermissionGroup.sensors | NSMotionUsageDescription | PermissionGroupSensors | -| PermissionGroup.bluetooth | NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription | PermissionGroupBluetooth | -| PermissionGroup.appTrackingTransparency | NSUserTrackingUsageDescription | PermissionGroupAppTrackingTransparency | -| PermissionGroup.criticalAlerts | UNAuthorizationOptionCriticalAlert | PermissionGroupCriticalAlerts | -| PermissionGroup.assistant | NSSiriUsageDescription | PermissionGroupAssistant | +| 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 | | PERMISSION_NOTIFICATIONS | +| PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMedia | PERMISSION_MEDIA_LIBRARY | +| PermissionGroup.sensors | NSMotionUsageDescription | PERMISSION_SENSORS | +| PermissionGroup.bluetooth | NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription | PERMISSION_BLUETOOTH | +| PermissionGroup.appTrackingTransparency | NSUserTrackingUsageDescription | PERMISSION_APP_TRACKING_TRANSPARENCY | +| PermissionGroup.criticalAlerts | UNAuthorizationOptionCriticalAlert | PERMISSION_CRITICAL_ALERTS | +| PermissionGroup.assistant | NSSiriUsageDescription | PERMISSION_ASSISTANT | 4. Clean & Rebuild diff --git a/permission_handler_apple/example/ios/Runner/AppDelegate.swift b/permission_handler_apple/example/ios/Runner/AppDelegate.swift index 70693e4a8..b63630348 100644 --- a/permission_handler_apple/example/ios/Runner/AppDelegate.swift +++ b/permission_handler_apple/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/permission_handler_apple/example/ios/Runner/Info.plist b/permission_handler_apple/example/ios/Runner/Info.plist index e31eecab1..aeffd01b3 100644 --- a/permission_handler_apple/example/ios/Runner/Info.plist +++ b/permission_handler_apple/example/ios/Runner/Info.plist @@ -102,6 +102,10 @@ NSUserTrackingUsageDescription appTrackingTransparency + + UNAuthorizationOptionCriticalAlert + Authorization Option Critical Alert + NSSiriUsageDescription The example app would like access to Siri Kit to demonstrate requesting authorization. From 74a8ddc539e0b5bb0147f800ea218b431172da2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E5=9B=BD=E7=A5=A5?= Date: Sun, 6 Jul 2025 16:40:17 +0800 Subject: [PATCH 3/4] docs: Fixed the permission declaration example in the AndroidManifest.xml file --- .../lib/src/permissions.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/permission_handler_platform_interface/lib/src/permissions.dart b/permission_handler_platform_interface/lib/src/permissions.dart index b81a99f28..39a323db7 100644 --- a/permission_handler_platform_interface/lib/src/permissions.dart +++ b/permission_handler_platform_interface/lib/src/permissions.dart @@ -102,8 +102,8 @@ class Permission { /// - Devices running Android 13 (API level 33) and above: Should use [Permission.photos]. /// /// EXAMPLE: in Manifest: - /// <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/> - /// <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/> + /// ; + /// ; /// /// In Flutter to check the status: /// From 755c58455881060d172d63c65e2501e6ec1bdb86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E5=9B=BD=E7=A5=A5?= Date: Sun, 13 Jul 2025 16:08:13 +0800 Subject: [PATCH 4/4] =?UTF-8?q?docs(permission=5Fhandler=5Fplatform=5Finte?= =?UTF-8?q?rface):=20=E6=9B=B4=E6=96=B0=E6=9D=83=E9=99=90=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修正 AndroidManifest 文件权限示例的 XML 格式 - 将 angle brackets (< 和 >) 替换为正确的 < 和 > --- .../lib/src/permissions.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/permission_handler_platform_interface/lib/src/permissions.dart b/permission_handler_platform_interface/lib/src/permissions.dart index 39a323db7..b81a99f28 100644 --- a/permission_handler_platform_interface/lib/src/permissions.dart +++ b/permission_handler_platform_interface/lib/src/permissions.dart @@ -102,8 +102,8 @@ class Permission { /// - Devices running Android 13 (API level 33) and above: Should use [Permission.photos]. /// /// EXAMPLE: in Manifest: - /// ; - /// ; + /// <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/> + /// <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/> /// /// In Flutter to check the status: ///