Monaca Onsen UI Discord Chat Github Repo

Problem with images on iOS



  • Hi everyone.
    I’m working on an app to take a picture and show it inside an img tag.
    On Android everything works fine, but on iOS it just don’t show the image. If the capture fails, it shows an error message, but if the image is correctly taken, it just does nothing. No message, no error, no warning…

    This is the simple code I’m using:

    document.addEventListener(“deviceready”, onDeviceReady, false);
    function onDeviceReady() {
    navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
    destinationType: Camera.DestinationType.FILE_URI });
    }

    function onSuccess(imageURI) {
    var image = document.getElementById(‘img’);
    image.src = imageURI;
    }

    function onFail(message) {
    alert('Failed because: ’ + message);
    }

    Is there anything wrong?.. do I need special permissions or something?
    I have activated the camera plugin on cordova, enabled the use of camera on iPhone… I don’t know what else could it be.

    Please, help!!!
    Thanks!