Jump to content

Recommended Posts

Posted

Hello

I call the Binary Eye application with the following code and return to the application after reading the barcode.

procedure TMainmForm.btnScanClick(Sender: TObject);
var
  ScanURL: string;
begin

  ScanURL := 'http://markusfisch.de/BinaryEye?ret=' +
    'https://192.168.0.173:8077/m/?result={RESULT}';

  UniSession.AddJS('window.location.href="' + ScanURL + '";');
end;

I also wrote the following code in the AfterShow event

procedure TMainmForm.UnimFormAfterShow(Sender: TObject);
begin
  UniSession.AddJS(
    'var params=new URLSearchParams(window.location.search);' +
    'if(params.has("result")){' +
    '  var code=params.get("result");' +
    '  localStorage.setItem("lastBarcode", code);' +
    '  document.getElementById("' + lblResult.JSName + '").innerText="Barcode: "+code;' +
    '  window.history.replaceState({}, document.title, window.location.pathname);' +
    '}'
  );
end;

But don't display the scanned code as a lblResult.

https://github.com/markusfisch/BinaryEye

 

Regards.
But I didn't get the scanned code

×
×
  • Create New...