0

我尝试了 firebase ml kit 并得到了错误这个 TypeError: (0 , _ml.default)(...).cloudDocumentTextRecognizerProcessImage is not a function

const onPressActionGallery = () => {
    ImagePicker.openPicker({
      cropping: true,
      includeBase64: true,
    })
      .then(async image => {
        const tempPhoto = [...uploadData.photo];
        const photoIndex = tempPhoto.findIndex(
          photo => photo.path === image.path,
        );
        if (photoIndex !== -1) {
          tempPhoto.splice(photoIndex, 1);
        } else {
          tempPhoto.push(image);
        }
        setUploadData(prev => {
          return {
            ...prev,
            photo: tempPhoto,
          };
        });
        const processingResult =
          await ml().cloudDocumentTextRecognizerProcessImage(tempPhoto);
        console.log(processingResult, 'processingResult');
      })
      .catch(err => console.log(err, 'err'));
  };

4

0 回答 0