Skip to Content
0
Dec 14, 2018 at 11:16 AM

Cordova barcode scanner unable to open camera on ui5 app(desktop)

1010 Views Last edit May 21, 2020 at 05:35 PM 2 rev

Hi,

Cordova barcode scanner plugin is unable to open camera in ui5 app due to error in quagga.min.js file which is coming from SAP Cloud Platform. Here is the source URL: "

https://webidecp-a*******6.dispatcher.hana.ondemand.com/hatdi_acf0c8a6f/hybrid/cordovafacade/plugins/com.sap.mp.cordova.plugins.barcodescanner/src/browser/quagga.min.js

".

quaggamin-copy.txt

Camera permission was given. Few days back scanning was working on desktop app, but since yesterday i am getting white screen instead of camera. I can see white led light on beside camera lens of laptop. This app is working fine on fiori client.

The following details are with respect to the same app on SAP Cloud Platform Portal Service (Fiori Launchpad):

1. cordova is being detected on web ide (index.html run), but it is not available on Portal Service. I don't understand why the difference in behavior when the code is same across both services. I can only run this app on fiori client(App deployed on SAP Portal).

cordova-barcode-scan-plugin-issue-on-scp-portal.jpg

2. Application folder contents are divided into two separate folders - "sap/fiori/application" and "sites". Why this happens. Please refer image file for details. This kind of folder structure creates issue for rendering custom image on app. I had to go with a workaround for displaying custom images in app on Fiori launchpad.

3. View controller source code appears in single line, where as on Web IDE full stack it is displayed in proper format. I have to click on Pretty-print option to get it displayed in proper format(as displayed in above image). Local variables are replaced with run time variable names, which some times makes debugging difficult. Why this happens?

Lastly, How does one debug an app in SAP Fiori Client?

Please help me understand why so many things are behaving differently.

Thank you.

Regards,

Saurabh Singh.