Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application gets restarted if the camera permission is changed

I've implemented a short Flutter App which is requesting and checking the camera permission which works as expected. But, when manually changing the camera permission from the app settings, for both Android and iOS, it will restart my app. I need to mention that I've added in AndroidManifest.xml and Info.plist the required keys for camera. One interesting thing is that for the location the behaviour is fine and the app does not get restarted.

For permissions I'm using the permission_handler flutter library.

I don't know if is a flutter issue or a general mobile known behaviour but if someone knows more please let me know. If someone need some code example I can also provide this. Thank you.

like image 813
Florin Laudat Avatar asked Jun 11 '20 09:06

Florin Laudat


1 Answers

It doesn't get 'restarted', it gets killed. Meaning, it will run from app launch the next time. This is because some permission settings cannot be changed while the App is running. This is by design.

like image 113
bauerMusic Avatar answered Sep 28 '22 00:09

bauerMusic