Dhaval2404 / ImagePicker

📸Image Picker for Android, Pick an image from Gallery or Capture a new image with Camera

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Camera permission is redundant and decreases supported devices count

PerrchicK opened this issue · comments

commented

Hi,
Thanks a lot for this component, it saved me a lot of work!
I'm using v1.3 and when I try to publish my new bundle, Google Play Store tells me that some devices will not be compatible with the new version, it occurs because of this library.

In the readme file you've mentioned:

<!--
If Not using Camera feature, Add following line in app manifest.
This will remove permission while manifest merge
-->
<uses-permission android:name="android.permission.CAMERA" tools:node="remove"/> 

But, there's no actual need for this permission, unless of course you're presenting an embedded camera preview. If I'm not mistaking there's no embedded camera preview here, for now.

So:

  1. Can we remove it?
  2. We can add an option to your API that will ignore camera permissions, because when I'm using tools:node="remove" in the manifest this library simply ignores my request due to "missing permissions", which is wrong (that's the actual issue here).
  3. However, if you like, you can use activity.packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY) to prevent camera usage when it is not available.

LMK what you think, I'll be glad to help :)

@PerrchicK Thank you so much for raising this issue. I didn't know that camera permission is not required for intent. Will update the lib by tonight or max by tomorrow.

Thank you!