Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IdBarcodeRecognizer TimeOut. #212

Open
aarango opened this issue Apr 24, 2023 · 2 comments
Open

IdBarcodeRecognizer TimeOut. #212

aarango opened this issue Apr 24, 2023 · 2 comments

Comments

@aarango
Copy link

aarango commented Apr 24, 2023

I need activate one time out or know the lecture numbers for know if the camera don't recognize the barCode, I search in the options but I dont see results , this is possible? - I need help.

This property exist ?

This is my implementation.


import React, { useEffect } from 'react'
import * as BlinkIDReactNative from 'blinkid-react-native'
import { useIsFocused } from '@react-navigation/native'
import { View, Platform } from 'react-native'
import Constants from 'expo-constants'
import { styles } from './styles'

const licenseKey = Platform.select({
  ios: Constants.manifest.extra.iosApiKeyBlinkId,
  android: Constants.manifest.extra.androidBlinkIdApiKey,
})

function CameraPDF417({ onScanedQr, title = '' }) {
  const isFocused = useIsFocused()

  async function scan() {
    try {
      const uiSettings = new BlinkIDReactNative.BlinkIdOverlaySettings()
      uiSettings.firstSideInstructionsText = title

      const idBarcodeRecognizer = new BlinkIDReactNative.IdBarcodeRecognizer()

      const scanningResults = await BlinkIDReactNative.BlinkID.scanWithCamera(
        uiSettings,
        new BlinkIDReactNative.RecognizerCollection([idBarcodeRecognizer]),
        licenseKey,
      )
      if (scanningResults) {
        console.log('scanningResults', scanningResults)
        // onScanedQr(scanningResults)
      } else {
        console.log('scanningResults', scanningResults)
      }
    } catch (error) {
      console.log('ERROR CAMERA', error)
    }
  }

  useEffect(() => {
    ;(async () => {
      await scan()
    })()
  }, [isFocused])

  return <View style={styles.container} />
}

export { CameraPDF417 }
@MBrizic01
Copy link

Hello @aarango , thank you for reaching out. If you are referring to the partial recognition timeout feature, you can implement it and set it to the number of seconds that fits your needs.
Just to give more context, with the partial recognition timeout feature, the SDK will return the partial results to the user that it managed to scan after the number of seconds you've previously put in cases where it was not successful in extracting the 100% of the fields we support reading.
Please check here how to set it up.

@aarango
Copy link
Author

aarango commented May 19, 2023

No I wanna close the camera in determinate time, for example wen the camera is open await 10 secons and close de camera. This is posible I cant see eny method to close camera. They only close with the user press the button close or the reader is succesfull. I need help to controllet this method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants