Cordova Camera Plugin does not trigger success or failure feedback

1

I'm trying to use the latest version (2.2.0) of Cordova Camera Plugin in an app I'm developing on Intel XDK. My javascript and HTML are:

<script type="text/javascript" charset="utf-8">
    function onSuccess(imageURI) {
        alert(imageURI);
        var image = document.getElementById('image');
        image.src = imageURI;
    }    
    function onFail(message) { alert('Failed because: ' + message); }

    function capturePhoto() {
        navigator.camera.getPicture(onSuccess, onFail, {
            destinationType: Camera.DestinationType.FILE_URI,
            mediaType: Camera.MediaType.PICTURE,
            saveToPhotoAlbum: true,
            sourceType: Camera.PictureSourceType.CAMERA            
        });
    }
</script>  

<button onclick="capturePhoto();">Capture Photo</button> <br>
<center>
    <img style="width:260px;height:260px;" id="image" src="" />
</center>

The camera opens normally, I take the photo and confirm that it will be the one I will use. But when you go back to the application neither the onSuccess function or the onFail function is performed. The photos are being saved successfully.

I've tried a few things:
Do something with the Android Event Pipeline
Listen to the event resume

    
asked by anonymous 23.06.2016 / 13:29

0 answers