cancel
Showing results for 
Search instead for 
Did you mean: 

Barcide scanning Native for sap fiori client and quagga for browser should work together

former_member338801
Participant
0 Kudos

Hello Developers,

I have a requirment from the business to implent Barcide as given below. I have achieved this for sap fiori client native and desktop browser quaggga but in case of mobile browser it is not working.If you have any thought please respond asap.

1) If you run application on sap Fiori client app then ut should trigger Cordova API(native)

2) If you are using desktop or mobile browser then it should trigger quagga.js.

Thanks and Regards

RK

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor
0 Kudos

You just need to check if the cordova plugin is available or not. Obviously in your browser the plugin will not be available.

So you need to check that

if( window.cordova ){ 
// -> This might be window.cordova or window.parent.cordova or simply 'cordova' 
// -> it depends on how you have instantiate it
// Here Execute the cordova plugin
} else { 
// Call your JS file code
}

BR,

Mahesh

former_member338801
Participant

Hi Mahesh,

Thanks for your quick help!

It's working.

Thanks and Regard

RK

Answers (1)

Answers (1)

0 Kudos

Hi Ram,

Could you please share your code and step.

Much appreciate your help On this.

Regards,

Sathish

former_member338801
Participant
0 Kudos

Hi Satish,

You have to apply quagga js bar code and then try to aply native code according to your requirment.

onScanForValue: function(oEvent){ if(window.parent.cordova){ Adjust your code according to Quagga }else{ use Quagga link : https://blogs.sap.com/2017/10/19/barcode-scanning-with-device-camera-in-sapui5-applications-without-... }

BR,

RK