CamerAwesome icon indicating copy to clipboard operation
CamerAwesome copied to clipboard

Don't include permissions automatically

Open Zazo032 opened this issue 2 years ago • 18 comments

Proposal

When showing the camera preview, there are a couple permissions that get automatically requested, even if they're not used:

  • Microphone: we're only interested in the camera for photos, so even if I set enableAudio: false, the permission is added to the Manifest and automatically requested.
  • Location: we're not interested in saving exif data on images, but still the location permission dialog appears when starting the camera.

The list of permissions shouldn't be included by default in the manifest, apart from the camera/media permission. Since microphone and location is optional, make the permissions in the manifest also opt-in (the dev will have to manually add it to the manifest). This will prevent having to add docs to Play Store on why there's a location/microphone permission

Zazo032 avatar Dec 19 '22 14:12 Zazo032

Yes we have this in mind. I add it to the next feature 👌

g-apparence avatar Dec 19 '22 16:12 g-apparence

Is this issue fixed?

bh-jayadeep avatar Jan 16 '23 09:01 bh-jayadeep

@bh-jayadeep Not yet.

We'll post an update here when it's done.

apalala-dev avatar Jan 16 '23 12:01 apalala-dev

This has been addressed with 1.2.0. Now, both these permissions need to be added manually. They will be prompted only when they are used (when setting the location for the location, when starting a recording with audio enabled for the microphone).

I'll close the issue as it seems resolved but feel free to reopen or create a new one if there is still a problem.

apalala-dev avatar Jan 25 '23 13:01 apalala-dev

On iOS the microphone permission is still requested on version 1.4.0. I'm using CameraAwesomeBuilder.previewOnly which sets enableAudio: false so the microphone permission shouldn't be required. If I don't allow the microphone permission, there is an error the next time I'm using .previewOnly:

PlatformException(VIDEO_ERROR, error when trying to setup audio, ..)

chrisgblr avatar Apr 26 '23 16:04 chrisgblr

App Store send an email state that "NSMicrophoneUsageDescription" should be added to info.plist.

Anyway to avoid entering just purpose string, if I am not using microphone function?

cchamm avatar May 02 '23 08:05 cchamm

@cchamm If you don't input a clear an concise description of why you are using any of the specific permissions Apple will reject your app submission. Had it happen to me a while ago.

vlazdra avatar May 10 '23 14:05 vlazdra

@cchamm @vlazdra The just_audio package found a good solution for cases like this: https://pub.dev/packages/just_audio#ios

chrisgblr avatar May 10 '23 14:05 chrisgblr

@chrisgblr Just tried it locally in my project and the permission popup still get's shown. It might be that the GCC Preprocessor is for the audio library only.

vlazdra avatar May 10 '23 15:05 vlazdra

Any update?

sezer avatar May 12 '23 11:05 sezer

@sezer It seams that a fix has been introduced but merged only towards the next major release of 2.0.0 (https://github.com/Apparence-io/CamerAwesome/pull/340).

Not sure if it's planned to be added as a bugfix version or not.

Might be a good idea to at least share a release timeline of 2.0.0.

vlazdra avatar May 12 '23 13:05 vlazdra

@vlazdra The permission popup is shown because camerawesome is requesting it even if enableAudio: false. That needs to be fixed. The solution i posted (https://pub.dev/packages/just_audio#ios) only prevents the app store from detecting the usage of the microphone API and rejecting your app submission which you said happened to you before.

chrisgblr avatar May 12 '23 13:05 chrisgblr

You can expect a pre release of the v2.0 this week

istornz avatar May 16 '23 07:05 istornz

Version 2 prerelease is now published 👍

istornz avatar May 17 '23 12:05 istornz

@istornz Thx. I'm gonna try today later. And the migration guide link is broken on pub.dev. There is an 's' missing after migration_guide. FYI

sezer avatar May 17 '23 14:05 sezer

I have tried the new version on iOS and Android. Before opening the camera preview screen, I ask the user for camera and microphone permissions. A possible selection from the user could be that he accepts camera permission and rejects the microphone permission. In that case when creating the CameraAwesomeBuilder.custom builder I set the enableAudio to false

saveConfig: SaveConfig.video(
          videoOptions: VideoOptions(
            enableAudio: false,
          ),

But then onPreparingCamera I get the following error:

PlatformException(VIDEO_ERROR, error when trying to setup audio, Cannot use iPhone Microphone, null)

The above scenario works as expected on Android. But on iOS I get the above Exception.

aggeloskoutanis avatar May 19 '23 09:05 aggeloskoutanis

it still a bug ?

luyongfugx avatar Apr 29 '24 13:04 luyongfugx

No idea. I chose to use the camera package from flutter instead.

aggeloskoutanis avatar Apr 29 '24 17:04 aggeloskoutanis