Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expired Licence key crashes the application #23

Open
mehulcs opened this issue Apr 28, 2021 · 6 comments
Open

Expired Licence key crashes the application #23

mehulcs opened this issue Apr 28, 2021 · 6 comments

Comments

@mehulcs
Copy link

mehulcs commented Apr 28, 2021

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

@anjapenic
Copy link

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
Copy link
Author

mehulcs commented Apr 29, 2021

Hi Anja, Thanks for responding.

I'm looking for either of 2 solutions

  • Catch the exception of license expiry to avoid a crash. Putting a try/catch with PlatformException doesn't help.
  • Way to check if the license is expired before starting the scanner that would not crash the application.

Error reported from the Crashlytics.

Fatal Exception: MBInvalidLicenseKeyException
Your license key is invalid! License has expired on 2021-04-28

@anjapenic
Copy link

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
Copy link
Author

mehulcs commented May 6, 2021

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
Copy link
Author

mehulcs commented May 6, 2021

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants