-
-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Please see issue #10 . It is not solved yet. The context which is bound to the callback function is still wrong. Please look into referenced issue for screenshots of the debugger.
I see two problems in line:
mlkit/packages/mlkit-core/index.ios.ts
Line 209 in 353ede1
if (this.detectionType === DetectionType.None || !this.hasListeners?.(MLKitView.detectionEvent)) { |
I assume the context of the callback function is TNSMLKitHelper instead of MLKitView. Therefore the first condition of the if statement fails.
This could be resolved by binding the callback to the MLKitView explicitly. Hence replace
mlkit/packages/mlkit-core/index.ios.ts
Line 45 in 353ede1
this.#mlkitHelper.onScanCallback = this._onScanCallback; |
with
this.#mlkitHelper.onScanCallback = this._onScanCallback.bind(this);
However, then the second problem arises with the second condition in the if statement
this.hasListeners?
is unfortunately null. I unfortunately do not understand the logic behind this piece of code and therefore have no idea how to resolve the second part of the problem.