BlinkID / blinkid-flutter

ID scanning plugins for cross-platform apps built with Flutter.
77 stars 23 forks source link

Expired Licence key crashes the application #23

Open mehulcs opened 3 years ago

mehulcs commented 3 years ago

API to check if the license key is expired is missing.

anjapenic commented 3 years ago

Hi @mehulcs,

Could you give us a bit more info on the issue? Are you asking about the method which would catch a license key exception and inform the user if there is a problem with the license key?

Are you getting a license key crash?

Regards, Anja

mehulcs commented 3 years ago

Hi Anja, Thanks for responding.

I'm looking for either of 2 solutions

Error reported from the Crashlytics.

Fatal Exception: MBInvalidLicenseKeyException
Your license key is invalid! License has expired on 2021-04-28
anjapenic commented 3 years ago

Hello @mehulcs,

Thank you for waiting for our answer.

There is a way to wrap the code which starts the scanner with a try/catch block like this:

try{
  var results = await MicroblinkScanner.scanWithCamera(
          RecognizerCollection([idRecognizer]), settings, license);
      if (!mounted) return;
      //code for handling results
} on PlatformException catch(ex){
print(ex)
}

However, when obtaining a production license key, you'll get a license that doesn't expire and it won't crash the app like an expired trial or pilot license could, so you would only need the try/catch block in your testing period.

Hope this helped, let us know if it worked for you when you test it out. Also, if you have any further questions feel free to ask.

Regards, Anja

mehulcs commented 3 years ago

Hi @anjapenic

Thanks for responding, Putting try/catch block as mentioned above in the sample code still doesn't work. It still crashes the application.

mehulcs commented 3 years ago

Also, there's one more issue with the scanning functionality, the Library is able to scan the passports and parse the result, But the type of the document always returns Types.None for passport documents. For the driver's license, the type is returned correctly.

I'm reading the type from below field, result.classInfo.type

I have scanned passports of the below countries, But none of them returns the type.

Spain
German
India
Australia
Ireland
New Zealand
USA
Canada
China

Thanks.

anjapenic commented 3 years ago

Hello @mehulcs,

Could you contact us at support@microblink.com so we could inspect your license key and check what's causing the crash?

Regards, Anja