Why cordova-plugin-camera callback function not working on Android 7 in ionic1 when picture capture.
I am trying to upload image and show preview in my app Ionic1 using cordova plugin-camera.
I have created Service for this plugin and call functions takePicture function on the Android version 6.0.1 its working fine But on the Android 7 camera open and take picture after taking picture ,click ok then nothing happens navigate to Home page and no callback call in android 7.
cordova-plugin-camera v= 2.4.1
cordova-plugin-compat v= 1.1.0
Node js 6.10.3
What should i do for this to work on the Android 7
Below is the code i am using.
CameraSvc.takePicture({}, function(data) {
var card = ‘data:image/jpeg;base64,’ + data;
if (side === ‘Card - Front’) {
scope.frontImageData = card;
} else {
scope.backImageData = card;
}
$ionicLoading.show({
template: ‘Saving image…’
});
if (card || metadata) {
var callback = function() {
scope.frontImageData = scope.backImageData = scope.frontImageMetadata = scope.backImageMetadata = null;
_fetchCards();
$ionicLoading.hide();
};
LocalImagesSvc.saveUpdateImage(side, card, metadata, callback, callback);
}
});