Reputation: 129
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.
Upvotes: 7
Views: 2380
Reputation: 19
The native Android application's onCreate method is called after a permission is changed. Sometimes it may be called instantly after permission change and sometimes the OS may take upto several minutes to invoke application's onCreate.
Upvotes: -1
Reputation: 6166
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.
Upvotes: 8