typescriptionic-frameworkionic4microblinkblinkid

ERROR TypeError: BlinkId is not a constructor Ionic 4


When i try to run this code it crash and say this error:

ERROR TypeError: this.blinkId.BlinkCardOverlaySettings is not a constructor

whats wrong? i think its a plugin problem on the typescript Microblink SDK wrapper this is a sample from BlinkId Plugin

import { BlinkId, RecognizerResultState } from '@ionic-native/blinkid/ngx';
constructor(private blinkId: BlinkId) {}

scan(){

const overlaySettings = new this.blinkId.BlinkCardOverlaySettings();
const recognizer = new this.blinkId.BlinkCardRecognizer();
recognizer.returnFullDocumentImage = false;
recognizer.detectGlare = true;
recognizer.extractCvv = true;
recognizer.extractValidThru = true;
recognizer.extractOwner = true;

const recognizerCollection =  new this.blinkId.RecognizerCollection([recognizer]);
const canceled = this.blinkId.scanWithCamera(
  overlaySettings,
  recognizerCollection,
  {
    ios: 'my key', //iOS License Key
    android: my key' //Android License Key
  },
);

  if (!canceled) {
    if (recognizer.result.resultState === RecognizerResultState.valid) {
      const results = recognizer.result;

      if (results.resultState === RecognizerResultState.valid) {
        const ccInfo = {
          cardNumber: Number(results.cardNumber),
          expirationMonth: Number(results.validThru.month),
          expirationYear: Number(results.validThru.year),
          cvv: Number(results.cvv)
        };
        console.log("TCL: scan -> ccInfo", ccInfo)
      }
    }
    }
}

Solution

  • Since version 5.0, release only includes Document and BlinkIdOverlay and following reconizers:

    In our new sample project, index.js is set on this way: https://github.com/BlinkID/blinkid-phonegap/blob/master/www/js/index.js

    We are now distributing full version with all recognizer and overlays included trough our dashboard: https://microblink.com/login

    Simply log in and verify your email and we will enable you full SDK version.

    You can always reach us directly to support@microblink.com

    Best regards.

    So i made this plugin