Problem on the scan QR-Code on the IOS

When i scan the QR-Code on the ios,i see this window: 



mvp_badge
MVP

Hi Gaetano,

I fail to see how your question has anything to do with OutSystems. Are you using a mobile plugin to scan a QR code? Which one? Does your app have permissions to use the camera in iOS?

i use this component:

mvp_badge
MVP

But what Forge component is that? I can't find a component with that name.

sorry, i don't have a plugin, i have this client action: 

and we have this javascript:


var camera = 'rear';//$parameters.Camera == 'back'? 'back' : 'front';

var addDrawsight = $parameters.DrawSight;


ZXing.TemplateBuilder.buildInterface(addDrawsight, document.getElementById($parameters.Canvas_WidgetId));


codeReader = new ZXing.BrowserMultiFormatReader();

/*

document.getElementById('close-button').addEventListener('click', function() {

    codeReader.reset();

    document.getElementById('plugin-overlay').style.display = 'none';

    document.getElementById('video').pause();

    $parameters.ErrorMessage = "Failure during scan. Scan was cancelled";

    $parameters.Success = false;

}, true);

*/

var menuBackHandler = function() {

    codeReader.reset();

    document.getElementById('plugin-overlay').style.display = 'none';

    document.getElementById('video').pause();

   // $parameters.ErrorMessage = "Failure during scan. Scan was cancelled";

   // $parameters.Success = true;

    $parameters.IsBack = true; 

    history.back();

};


$public.Navigation.registerBackNavigationHandler(menuBackHandler);


var selectedDeviceId = null;

if(codeReader !== null){

    if(!codeReader.canEnumerateDevices){

        

        var divOverlay = document.getElementById('plugin-overlay');

        var video = document.getElementById('video');

        if (divOverlay !== null && video !== null) {

            video.parentNode.removeChild(video);

            divOverlay.parentNode.removeChild(divOverlay); 

        }

        

        var input = document.createElement("input");

        input.id = 'image-input'

        input.type = "file";

        input.accept = "image/* capture='camera'";

        input.style.display = 'none';

        document.body.appendChild(input);


        var outImg = document.createElement("img");

        outImg.id = 'outImage';

        //outImg.style.display = 'none';

        outImg.style.width = '320';

        outImg.style.height = '320';

        var cont = document.getElementById('reactContainer');

        cont.appendChild(outImg);


        input.click();


        input.addEventListener("change", function (evt) {

            var tgt = evt.target || window.event.srcElement,

                files = tgt.files;


            // FileReader support

            if (FileReader && files && files.length) {

                var fr = new FileReader();

                fr.onload = function () {

                    var outImg = document.getElementById('outImage');

                    outImg.src = fr.result;


                    codeReader.decodeFromImageElement('outImage')

                    .then(function (result) {

                        $parameters.Value = result.text;

                        $parameters.Success = true;

                        $resolve();

                    })

                    .catch(function (err) {

                        $parameters.ErrorMessage = "Could not find a barcode. Please try with a different image";

                        $parameters.Success = false;

                        $resolve();

                    })

                    .finally( function (){

                        var input = document.getElementById('image-input');

                        var outImg = document.getElementById('outImage');

                        if (input !== null && outImage !== null) {

                            outImg.parentNode.removeChild(outImage);

                            input.parentNode.removeChild(input); 

                        }

                        

                    });

                }

            fr.readAsDataURL(files[0]);

            }

        });

        return;

    }

    codeReader.getVideoInputDevices()

    .then(function(videoInputDevices) {

        var availableDevices = videoInputDevices.length;

        if (availableDevices === 0) {

            $parameters.ErrorMessage = "There are no available cameras. Verify your devices or permissions";

            $parameters.Success = false;

            return;

        }

        else if (availableDevices > 1){

            for(var i=0; i

                console.log("videoInput" + videoInputDevices[i].label);

                $parameters.VideoInput +=  "-" + videoInputDevices[i].label;

                if((videoInputDevices[i].label.toLowerCase()).includes(camera)) {

                    selectedDeviceId = videoInputDevices[i].deviceId;

                    break;

                }

            }

            if(selectedDeviceId === null) {

                console.log("videoInput2" + videoInputDevices[availableDevices-1].label);

                selectedDeviceId = videoInputDevices[availableDevices-1].deviceId;

            }

        }

        else {

            console.log("videoInput3" + videoInputDevices[0].label);

            selectedDeviceId = videoInputDevices[0].deviceId;

        }

        codeReader.decodeFromInputVideoDevice(selectedDeviceId, 'video')

            .then(function (result) {

                codeReader.reset();

                $parameters.Value = result.text;

                $parameters.Success = true;

                

                $resolve();

            })

            .catch(function (err) {

                $parameters.ErrorMessage = "Scan was cancelled";

                $parameters.Success = false;

                $resolve();

            })

            .finally( function (){

                var divOverlay = document.getElementById('plugin-overlay');

                var video = document.getElementById('video');

                if (divOverlay !== null && video !== null) {

                    video.parentNode.removeChild(video);

                    divOverlay.parentNode.removeChild(divOverlay); 

                }

            });

    })

    .catch(function(err) {

        $parameters.ErrorMessage = "Failure during scan.";

        $parameters.Success = false;

        $resolve();

    });

}

mvp_badge
MVP

If it's not a Forge component, and it's not standard OS functionality, then it must be a custom component, or code your company wrote themselves? Impossible to tell in that case what goes wrong.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.