CamerAwesome
CamerAwesome copied to clipboard
Don't include permissions automatically
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
Yes we have this in mind. I add it to the next feature 👌
Is this issue fixed?
@bh-jayadeep Not yet.
We'll post an update here when it's done.
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.
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, ..)
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 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.
@cchamm @vlazdra The just_audio package found a good solution for cases like this: https://pub.dev/packages/just_audio#ios
@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.
Any update?
@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 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.
You can expect a pre release of the v2.0 this week
Version 2 prerelease is now published 👍
@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
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.
it still a bug ?
No idea. I chose to use the camera package from flutter instead.