Content-Length: 255043 | pFad | https://github.com/NativeScript/mlkit/issues/19

1D IOS Bug: onDetection methods not called on IOS, this is still issue #10 · Issue #19 · NativeScript/mlkit · GitHub
Skip to content

IOS Bug: onDetection methods not called on IOS, this is still issue #10 #19

@cjohn001

Description

@cjohn001

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:

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/NativeScript/mlkit/issues/19

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy