blinkcard / blinkcard-capacitor

AI-driven credit card scanning for cross-platform apps built with Capacitor.
3 stars 2 forks source link

Angular and Capacitor, scanWithCamera undefined. #2

Closed svendjanis closed 3 years ago

svendjanis commented 3 years ago

Uncaught (in promise): TypeError: Cannot read property 'scanWithCamera' of undefined TypeError: Cannot read property 'scanWithCamera' of undefined

Cap Version: '3.0.1'

  async scan() {

    // Initialize plugin
    const plugin = new BlinkCard.BlinkCardPlugin();

    // Initialize wanted recognizer
    const blinkCardRecognizer = new BlinkCard.BlinkCardRecognizer();
    blinkCardRecognizer.returnFullDocumentImage = true

    // Initialize license
    const licenseKeys: BlinkCard.License = {
      ios: '',
      android: '',
      showTrialLicenseWarning: true
    };

    // Perform scan and gather results
    const scanningResults = await plugin.scanWithCamera(
      new BlinkCard.BlinkCardOverlaySettings(),
      new BlinkCard.RecognizerCollection([blinkCardRecognizer]),
      licenseKeys);
  }

I have tried this on the new project, cant figure out what is the issue. I would appreciate any help.

TCvetkovic commented 3 years ago

Hi Sven,

Thank you for waiting for our response.

This issue looks like something went wrong with plugin initialization.

Can you check do you have the same issue with our sample? If our sample is working, can you create some minimal sample app where this issue is possible to reproduce so we could take a look?

Thank you.

svendjanis commented 3 years ago

Hi Tomislav,

Thank you for your fast response. Just tried the sample app, it worked. I will try to implement it into my app now.

Edit: Just to update here. Tried now on the main app, it works. I had to do some automatic xcode fixes, I guess that resolved the issue.