Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
947 stars 234 forks source link

Don't include permissions automatically #176

Open Zazo032 opened 1 year ago

Zazo032 commented 1 year ago

Proposal

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

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

g-apparence commented 1 year ago

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

bh-jayadeep commented 1 year ago

Is this issue fixed?

apalala-dev commented 1 year ago

@bh-jayadeep Not yet.

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

apalala-dev commented 1 year ago

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.

chrisgblr commented 1 year ago

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, ..)

cchamm commented 1 year ago

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?

vlazdra commented 1 year ago

@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.

chrisgblr commented 1 year ago

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

vlazdra commented 1 year ago

@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.

sezer commented 1 year ago

Any update?

vlazdra commented 1 year ago

@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.

chrisgblr commented 1 year ago

@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.

istornz commented 1 year ago

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

istornz commented 1 year ago

Version 2 prerelease is now published 👍

sezer commented 1 year ago

@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

aggeloskoutanis commented 1 year ago

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.

luyongfugx commented 4 months ago

it still a bug ?

aggeloskoutanis commented 4 months ago

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