Skip to content

Detection Not calling in IOS #53

Open
@mastashake08

Description

@mastashake08

The camera will start if I manually create a MLKitView but no callback received

Steps to recreate

mounted() {
      LocalNotifications.requestPermission().then(() => {
        this.sendNotification('Starting scan', 'Scan your cards')
        this.initMLKit()
      })
    }
.......
initMLKit() {
        const image = new MLKitView();
        image.cameraPosition = CameraPosition.Front
        image.detectionType = DetectionType.Text
        image.torchOn = true

        image.requestCameraPermission().then(() => {
          console.log(image.detectionType)
          image.on('detection', this.onDetection)
        });
      },
      onDetection(event) {
        alert(event)
        if(event.type === DetectionType.Image){
          const text = event.data;
          this.sendNotification('Card recognized', event.data)
       }
      }
    }

I see the camera opens but I get zero detections

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