diff --git a/permission_handler_platform_interface/CHANGELOG.md b/permission_handler_platform_interface/CHANGELOG.md index ec818581f..0b68e034f 100644 --- a/permission_handler_platform_interface/CHANGELOG.md +++ b/permission_handler_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.1 + +* Updates Android documentation on how to use `permission.photo` on Android 12 (API 32) and below and Android 13 (API 33) and above. + ## 4.0.0 * **BREAKING CHANGE**: Replaces `Permission.calendarReadOnly` with `Permission.calendarWriteOnly`. diff --git a/permission_handler_platform_interface/lib/src/permissions.dart b/permission_handler_platform_interface/lib/src/permissions.dart index a24a8d254..29688ef74 100644 --- a/permission_handler_platform_interface/lib/src/permissions.dart +++ b/permission_handler_platform_interface/lib/src/permissions.dart @@ -94,13 +94,27 @@ class Permission { /// Depending on the platform and version, the requirements are slightly /// different: /// - /// **Android:** - /// - When running on Android 13 (API 33) and above: Read image files from - /// external storage - /// - When running below Android 13 (API 33): Nothing - /// /// **iOS:** /// - When running Photos (iOS 14+ read & write access level) + /// + /// **Android:** + /// - Devices running Android 12 (API level 32) or lower: use [Permissions.storage]. + /// - Devices running Android 13 (API level 33) and above: Should use [Permissions.photos]. + /// + /// EXAMPLE: in Manifest: + /// + /// + /// + /// In Flutter to check the status: + /// + /// if (Platform.isAndroid) { + /// final androidInfo = await DeviceInfoPlugin().androidInfo; + /// if (androidInfo.version.sdkInt <= 32) { + /// use [Permissions.storage.status] + /// } else { + /// use [Permissions.photos.status] + /// } + /// } static const photos = Permission._(9); /// Permission for adding photos to the device's photo library (iOS only). diff --git a/permission_handler_platform_interface/pubspec.yaml b/permission_handler_platform_interface/pubspec.yaml index 27abe566b..5fd41144e 100644 --- a/permission_handler_platform_interface/pubspec.yaml +++ b/permission_handler_platform_interface/pubspec.yaml @@ -3,7 +3,7 @@ description: A common platform interface for the permission_handler plugin. homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 4.0.0 +version: 4.0.1 dependencies: flutter: