I'm working on a mobile app using ionic framework. When I try to work with the cordova camera plugin (to take pictures or access the gallery) the app restarts.
I've found many forum threads and questions here about the subject, and the most useful one was this one: PhoneGap camera restarts the application
This question is 4 years old, and I think the solutions given are no longer compatible with newer version of cordova.
Is there any new solutions to the problem? I've been stuck for 3 days with this.
The question you mention may be 4 years old, but the issue remains the same: Android is killing off your Cordova app activity while it has been put in the background and the camera activity is in the foreground (see the Cordova documenation for a detailed explanation of the issue).
The essence of the accepted answer to that question is also still correct, but the plugins mentioned are out-of-date / have not been updated for new versions of Cordova.
I would suggest using one of the more recently updated forks (e.g https://github.com/zebra1024/cordova-plugin-wezka-nativecamera) of cordova-plugin-wezka-nativecamera
as the foreground camera plugin, since the original repo hasn't been updated in 2 years and has issues with the latest versions of Cordova.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With