To get the scan result firstly subscribe to the ScanSuccess delegate to catch the result callback.
private void OnEnable()
{
HMSScanKitManager.Instance.ScanSuccess += OnScanSuccess;
}
private void OnDisable()
{
HMSScanKitManager.Instance.ScanSuccess -= OnScanSuccess;
}
To open the camera for scanning run the following command.
public void Scan()
{
HMSScanKitManager.Instance.Scan(HmsScanBase.ALL_SCAN_TYPE);
}
You can catch the result at the method that subscribed to the ScanSuccess delegate.
private void OnScanSuccess(string text, HmsScan hmsScan)
{
Debug.Log("OnScanSuccess");
Txt_QRCode.text = text;
}