头图

sap.ndc.BarcodeScannerButton: Button control used to start the barcode scanning process (display barcode icon). If native scan functionality is not available or the camera functionality is not granted, the button is either hidden or provides a fallback by opening a dialog with an input field where barcodes can be entered manually. After the BarcodeScanner is loaded, execute the init method:

    //    * Feature vector (sap.Settings.isFeatureEnabled) is available
    //  * Barcode scanner is enabled by the Feature Vector
    //  * Barcode scanner Cordova plug-in (cordova.plugins.barcodeScanner) or zxing-js (ZXing.BrowserMultiFormatReader) is available

The available property defaults to true:

native device capabilities should be by default enabled if there is no feature vector available to restrict the capability.

The cordova API is not detected in the browser:

Then try to get ZXingAPI . This is an asynchronous process.

oZXingScannerAPI is available.

After clicking the barcode button, execute the scan method in line 129 of the following figure.

If the barcode scanning function is not available, start the barcode scanning process, display live input from the camera or display a dialog to enter the value directly.

Barcode scanning is done asynchronously. When it is triggered, the function returns without waiting for the scan process to complete. The application must provide callback functions to react to successful scans, errors during scans, and live input events on dialog boxes.

fnSuccess is passed an object with text, format and cancel properties. text is the text representation of the barcode data, format is the detected barcode type, and cancel is whether the user cancels the scan. fnError gives the error, fnLiveUpdate is passed the new value entered in the input field of the dialog.

The branch below line 584 is entered only if the CordovaScannerAPI is available:

Otherwise, go to line 618, and a dialog box will pop up.

SAP Fiori Client is a native mobile application runtime container for SAP Fiori applications. SAP Fiori Client allows users to access their SAP Fiori applications in online mode. Later, I will introduce how to solve the problem that the cordova plugin is unavailable in the Fiori client.


注销
1k 声望1.6k 粉丝

invalid