Please see issue https://github.com/NativeScript/mlkit/issues/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.
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.
Please see issue https://github.com/NativeScript/mlkit/issues/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:
https://github.com/NativeScript/mlkit/blob/353ede150655e33b36fb020be320653240dad285/packages/mlkit-core/index.ios.ts#L209
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
https://github.com/NativeScript/mlkit/blob/353ede150655e33b36fb020be320653240dad285/packages/mlkit-core/index.ios.ts#L45
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.