1

In the recent post for data protection page Android/playstore made it clear if you're taking images/videos from a device you need to ask permission.

Declares at least one of the following permissions: READ_EXTERNAL_STORAGE WRITE_EXTERNAL_STORAGE

Now flutter imagepicker is

No configuration required - the plugin should work out of the box.

And if I am asking permission explicitly app is not responding to the permission means not invoking what should I do. Flutter image-picker explicitly ask permission I am only picking images. Then uploading it to firebase.

Noobdeveloper
  • 405
  • 2
  • 6
  • 19

2 Answers2

1

On devices that run Android 4.4 (API level 19) and higher, your app can interact with a documents provider, including external storage volumes and cloud-based storage, using the Storage Access Framework. This framework allows users to interact with a system picker to choose a documents provider and select specific documents and other files for your app to open.

Because the user is involved in selecting the files or directories that your app can access, this mechanism doesn't require any system permissions[READ,WRITE Permission], and user control and privacy is enhanced. Additionally, these files, which are stored outside of an app-specific directory and outside of the media store, remain on the device after your app is uninstalled.

Note: If your app uses the media store, however, you must request the READ_EXTERNAL_STORAGE permission to access other apps' media files.


In the above case (image picker), uses ACTION_GET_CONTENT to open an file , which opens a system document picker using SAF framework and doesn't need permission.

Talkin about Data protection - When opening file using ACTION_GET_CONTENT - Because the user is involved in selecting the files or directories that your app can access. App has only access to a URI of image selected by the user, and there is no way to automate the image selection process, so user image is not altered in any way possible, and remain on the device after your app is uninstalled.

Image picker copies the result URI from document picker into a temp cache of your app, from where the image is uploaded to a firebase(or any other place you need a image) - See this answer to see how it picks the image - Flutter image picker.

Since this a official way provided by google - explained here, app should not cause any security threat to the user privacy

Further if you want(I hardly feel that needed), you can show a permission declaration dialog , stating that app is going to navigate to a file picker and saves a temp copy in app cache, not altering the original image in any way(or something similar you fells right).

Nitish
  • 3,075
  • 3
  • 13
  • 28
  • I am thinking of just asking permission explicitly using permission handler is there any problem with that approach? – Noobdeveloper Nov 15 '21 at 15:16
  • No, no problem with the approx , just it's not needed. You can still ask READ Permission it will give a user a idea about you have access to his storage. – Nitish Nov 15 '21 at 15:45
0

From the documentation - image_picker has been updated to make use of scoped storage.

In other words, you do not have to ask for permissions on devices running Android 10>. With Scoped Storage, you are granted permissions.

In your application, you can check if the device is running SDK 28< and ask permission if it is.

Have a look at the answers in this question.

HB.
  • 4,116
  • 4
  • 29
  • 53
  • what about google play data section caption you need at least one type of permission to handle photos/videos please check that above link – Noobdeveloper Nov 14 '21 at 07:11
  • @Noobdeveloper look at the first answer (The first paragraph) in the link provided above. – HB. Nov 14 '21 at 07:19