1

I'm trying to use the latest (2.2.0) Cordova Camera Plugin in an app I'm developing on Intel XDK. Here is my javascript and my HTML:

<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 app is opened, I take the picture, click "ok", but when I go back to the app neither onSuccess nor onFail is being fired. The pictures are being saved successfully.

I've already tried some things:
Do something with Android event pipeline
Listen to resume event

Community
  • 1
  • 1
  • I am expecting the same problem using Intel App Preview... – revobtz Dec 02 '16 at 16:47
  • I don't remember what I did to solve this, but in the Intel App Preview app, if I'm not mistaken, the plugins aren't in the package, so you can't test it there. –  Dec 04 '16 at 10:29
  • How its possible that this plugins aren't in the package so whats is the point with this App Preview if can't use the packages. The problem is that the camera opens when you click the button but when you take the photo the success or fail handlers aren't being fired. – revobtz Dec 06 '16 at 21:18
  • UPDATE: I installed my test app on a real android device with intel xdk build service and I am having the same behavior on Intel App Preview and the web simulator on my desktop PC... – revobtz Dec 19 '16 at 17:59

0 Answers0