Hey there! So, I've created a flashlight/torch app that can be found at the following link: https://github.com/Skelware/Fancy-Flashlight. This app utilizes a Cordova plugin available here: https://github.com/Skelware/Cordova-Flashlight.
For now, my main focus is on Android. In a nutshell, let me explain how this type of app functions on an Android device: The app needs to request access to the camera which happens in the background and takes some time for the camera to be loaded. Therefore, the loading and unloading process should occur as infrequently as possible. Once an app has access to the camera, no other app can request access to it.
When my app launches, it loads the camera and carries out its tasks. However, if the user switches to another app or closes mine, the camera remains locked to my app, preventing other apps from using the camera.
While I would prefer handling this issue on the JavaScript side, I'm open to addressing it natively within the plugin too.
It seems like the Window's unload event is triggered when completely exiting the app, but it doesn't provide ample time to release the camera.
The Cordova version being used is 4.0 and the Android version is 4.4, although I don't think this should make much of a difference.
What steps do you suggest I take to resolve this situation?