Skip to main content
Version: Current

Barcode Actions

  • os.showBarcode(code: string, format?: BarcodeFormat): ShowBarcodeAction

    Shows a Barcode for the given data. Optionally accepts the format that the barcode should be displayed in.

    The first parameter is a string and is the text or data that the generated Barcode should represent.

    The second parameter is optional and is a BarcodeFormat and is the format that the barcode should be displayed in. Defaults to "code128"

    Examples
    Show a Barcode that contains the data "hello".
    os.showBarcode("hello");
    Show a UPC Barcode that contains the data "123456".
    os.showBarcode("123456", 'upc');
  • os.hideBarcode(): ShowBarcodeAction

    Closes the Barcode popup modal.

    Examples
    Hides the Barcode popup modal.
    os.hideBarcode();
  • os.closeBarcodeScanner(): OpenBarcodeScannerAction

    Closes the barcode scanner.

    Examples
    Close the Barcode scanner.
    os.closeBarcodeScanner();
  • os.openBarcodeScanner(camera?: CameraType): OpenBarcodeScannerAction

    Opens the Barcode scanner. While open, each scanned Barcode will send a @onBarcodeScanned shout. Optionally accepts which camera to use for scanning. (front/back)

    The first parameter is optional and is a CameraType and a string specifing which camera to use. Defaults to 'rear'. If the given camera type is not available, then the default camera will be used. Possible values are "rear" and " front ".

    Examples
    Open the Barcode scanner.
    os.openBarcodeScanner();
    Open the Barcode scanner for the front-facing camera.
    os.openBarcodeScanner("front");
  • os.hideQRCode(): ShowQRCodeAction

    Closes the QR Code popup modal.

    Examples
    Hides the QR Code popup modal.
    os.hideQRCode();
  • os.showJoinCode(inst?: string, dimension?: string): ShowJoinCodeAction

    Shows a QR Code with a link to join the given inst and dimension. If the inst and dimension are omitted, then the current inst and dimension will be used.

    The first parameter is optional and is a string and is the inst that the code should be shown for. Defaults to the current inst.

    The second parameter is optional and is a string and is the dimension that the code should be shown for. Defaults to the current dimension.

    Examples
    Show a join QR Code for the current inst.
    os.showJoinCode();
    Show a join QR Code for a inst and dimension.
    os.showJoinCode("inst", "dimension");
  • os.showQRCode(code: string): ShowQRCodeAction

    Shows a QR Code for the given data.

    The first parameter is a string and is the text or data that the generated QR Code should represent.

    Examples
    Show a QR Code that contains the data "hello".
    os.showQRCode("hello");
    Show a QR Code that links to https://example.com
    os.showQRCode("https://example.com")
  • os.closeQRCodeScanner(): OpenQRCodeScannerAction

    Closes the QR Code scanner.

    Examples
    Close the QR Code scanner.
    os.closeQRCodeScanner();
  • os.openQRCodeScanner(camera?: CameraType): OpenQRCodeScannerAction

    Opens the QR Code scanner. While open, each scanned QR Code will send a @onQRCodeScanned shout. Optionally accepts which camera to use for scanning. (front/back)

    The first parameter is optional and is a CameraType and a string specifing which camera to use. Defaults to 'rear'. If the given camera type is not available, then the default camera will be used. Possible values are "rear" and " front ".

    Examples
    Open the QR Code scanner.
    os.openQRCodeScanner();
    Open the QR Code scanner for the front-facing camera.
    os.openQRCodeScanner("front");