Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If app is moved from background to foreground, camera is permanently in use #4

Open
alwinvollmer opened this issue Nov 2, 2023 · 6 comments

Comments

@alwinvollmer
Copy link

Tested with the native_qr example code.

Steps to reproduce:

  1. start example
  2. move app to background
  3. move app to foreground
  4. green dot is visible permanently in top right corner or iOS asks for camera permission

also green dot won't disappear until you either kill the app or open the qr scanner once.
issue only appears on iOS.

@roman-yerin
Copy link
Owner

Do I understand correctly, that the green dot is visible while the scanner preview is not presented?

@alwinvollmer
Copy link
Author

that is correct, yes.
also, the app should not ask for camera permission when moved to foreground.

what I forgot to mention in the steps to reproduce, the example app is a fresh install without any permissions set

@jeffreyerikson
Copy link

jeffreyerikson commented Jan 29, 2024

I am also experiencing this issue. Same steps to reproduce in my app:

  • run my app
  • put the app in the background by running another app
  • bring my app back to the foreground
  • the green "camera in use" light comes on

The only way to fix it is to kill the app, but the problem continues to happen if I re-open the app, then put it into the background again.

@roman-yerin
Copy link
Owner

@jeffreyerikson can you confirm this behavior with the sample app which you can find in this repo example directory? I tried to reproduce the issue with no luck. If I switch this example app to background, the green dot disappears and if I switch back I still see the camera preview and the green dot appears back.

@roman-yerin
Copy link
Owner

roman-yerin commented Jan 29, 2024

that is correct, yes. also, the app should not ask for camera permission when moved to foreground.

what I forgot to mention in the steps to reproduce, the example app is a fresh install without any permissions set

I believe, you have to take care of permissions on your own. The plugin should not explain to user why the app needs camera access, as this can be completely different cases.

@jeffreyerikson
Copy link

@jeffreyerikson can you confirm this behavior with the sample app which you can find in this repo example directory? I tried to reproduce the issue with no luck. If I switch this example app to background, the green dot disappears and if I switch back I still see the camera preview and the green dot appears back.

I'll try to get some time this week to see if I can reproduce with the example app on my hardware here; however, it appears the example is a single screen/view, but my case is more complex. The green dot is showing up when I'm in screens that don't do anything with QR scanning at all (note, too, QR scanning is the only thing in the app using the camera). The view that does the QR scanning has been disposed, the green dot disappeared, the app has navigated to a new route, then, when the app goes to background then is brought to the foreground again, the green dot reappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants