flutter_photo_manager icon indicating copy to clipboard operation
flutter_photo_manager copied to clipboard

[How to use] Android API 34 ACCESS_MEDIA_LOCATION is denied if user selected limited access to photos and videos

Open StigUK opened this issue 6 months ago • 1 comments

Platforms

Android

Description

I am requesting access to media files on Android 14 (api 34) using PhotoManager (version 3.0.0-dev.5). Provided that the user chooses not full, but limited access to the gallery of permissions, ACCESS_MEDIA_LOCATION is always returned as denied. This means I can't get coordinates from the metadata of a photo or video.

If the user gives full access, then the ACCESS_MEDIA_LOCATION status is returned as granted.

I don’t know for sure whether this is a library bug, or whether it’s a feature of API 34, which is why I didn’t file this as a bug report.

My code

import 'package:photo_manager/photo_manager.dart'; import 'package:permission_handler/permission_handler.dart';

Future test() async { final PermissionState permissionState = await PhotoManager.requestPermissionExtend(); final PermissionStatus accessMediaLocationStatus = await Permission.accessMediaLocation.status; ///If permissionState is limited => accessMediaLocationStatus is denied ///If permissionState is authorized => accessMediaLocationStatus is granted }

Try do it

No response

StigUK avatar Feb 23 '24 12:02 StigUK