Skip to content

Application crash with Ipad with torch enable true #19

@FranGhe

Description

@FranGhe

I use your plugin on my application and I noticed that it crash with Ipad with torch enable oprion is true

This is my code:

function startScanning(){
    const defaultOptions = {
        oneShot: true,      //default: false	
        detectionArea: {
            "width": 250, 
            "height": 250 
        },
         timeoutPrompt: {
            "show": true,                           //default: false    
            "timeout": 5,                           //default: -        
            "prompt": "Not detected"    //default: -        Timeout message.
        },
        torch: {
            "enable": true,             //default: false
            "defaultOn": false          //default: false
        },
        debug: {
            "preview": 0                //default: 0        
        }
    };
    monaca.BarcodeScanner.scan(
        (result) => {
            console.dir(result);
            if (result.cancelled){
                console.log("Scanner fermato dall'utente"); 
            }
            else{
                console.log(result.data.text);
                console.log(result.data.format);
            }
        }
        ,(error) => {
            console.log("Error:"+error);
        }
        ,defaultOptions
    );
}

If I set

torch: {
    "enable": false,             //default: false
    "defaultOn": false          //default: false
},

work properly... surely because I don't have a torch on my iPad.

Is there a way to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions