fluttercandies / flutter_photo_manager

A Flutter plugin that provides images, videos, and audio abstraction management APIs without interface integration, available on Android, iOS, macOS and OpenHarmony.
https://pub.dev/packages/photo_manager
Apache License 2.0
681 stars 309 forks source link

[Feature][Android] Support for MANAGE_MEDIA permission #891

Open ua741 opened 1 year ago

ua741 commented 1 year ago

Is your feature request related to a problem? Please describe.

For media management / gallery apps, the user should not see system pop up to confirm deletion of the media.

Describe the solution you'd like

Ability fetch the status and open Media management app settings so that user can toggle the permission for managing media.

Additional context

This permission is only available on Android 12 and above

Application will need to declare this permission in the Manifest.

<uses-permission android:name="android.permission.MANAGE_MEDIA">

To request the permission we need to invoke this intent with current package's name

https://developer.android.com/reference/android/provider/Settings#ACTION_REQUEST_MANAGE_MEDIA

We can fetch the permission status using this API

MediaStore.canManageMedia(ctx)

vantutrieu97 commented 1 year ago

vote vote