Jump to top

VisionBarcodePhone

interface

A phone number and it's detected type, e.g. VisionBarcodePhoneType.MOBILE

Example
import vision, { VisionBarcodeValueType } from '@react-native-firebase/ml-vision';

const [barcode, ...otherBarcodes] = await vision().barcodeDetectorProcessImage(filePath);

if (barcode && barcode.valueType === VisionBarcodeValueType.PHONE) {
  console.log(barcode.phone);
} else if (barcode && barcode.valueType === VisionBarcodeValueType.CONTACT_INFO) {
  console.log(barcode.contactInfo.phones[0]);
}

Properties

number

</>

The detected phone number.

number: string | null;

type

</>

Gets type of the phone number, e.g. VisionBarcodePhoneType.MOBILE.

type: number;