PDF417/pdf417-phonegap

Invalid license

Closed this issue · 3 comments

I tried the example code on android 6 device, but I always get the Invalid License popup.
I used the mobi.pdf417.demo as the app id, and the logcat outputs:

E/AppProtection.cpp:417(21474): Invalid key length! Key should have 8 blocks of 8 characters!
E/Pdf417ScanActivity.java:358@main(21474): INVALID LICENCE KEY
E/Pdf417ScanActivity.java:358@main(21474): com.microblink.recognition.InvalidLicenceKeyException: Failed to validate licence key. Reason: Invalid key length! Key should have 8 blocks of 8 characters!

This is the code, I modified the plugin locally to access pdf417Scanner directly, and not through cordova.plugins.

var types = ["PDF417", "QR Code"];
var options = {
    beep : true,  // Beep on
    noDialog : true, // Skip confirm dialog after scan
    uncertain : false, //Recommended
    quietZone : false, //Recommended
    highRes : false, //Recommended
    inverseScanning: false,
    frontFace : false
};
// This license key allows setting overlay views for this application ID: mobi.pdf417.demo
// Valid until 2018-06-04
var licenseiOs = "sRwAAAEQbW9iaS5wZGY0MTcuZGVtbz/roBZ34ygXMQRMupTjSPXnoj0Mz1jPfk1iRX7f78Ux6a+pfXVyW0HCjPTxl5ocxgXWF66PTrtFUbJFCDUpyznreSWY4akvhvqVFfcTYgVEKjB+UqO6vPD5iIaUCaEYhF4dVmM=";
// This license is only valid for package name "mobi.pdf417.demo"
var licenseAndroid = "sRwAAAAQbW9iaS5wZGY0MTcuZGVtb2uCzTSwE5Pixw1pJL5UEN7nyXbOdXB61Ysy/sgAYt4SaB0T/g6JvisLn6HtB8LzLDmpFjULMxmB8iLsy3tFdHtMhLWOM6pr0tQmSLGyhrXfe6rVoHAxJtPrFEoCNTk4RjLltQ==";

pdf417Scanner.scan(
  function callback(scanningResult) {
    console.log('Success', scanningResult);
  },
  function errorHandler(err) {
      console.log('Error', err);
  },
  types, options, licenseiOs, licenseAndroid
);

What am I doing wrong?

The license keys you are using require version 7.0.0 or newer.

culoi commented

Hello @elmismopancho

Looks like you are using an older version of the pdf417-phonegap.

That is the reason why you are getting "Invalid key length!" error.

You can download the latest version (7.0.0.) from our GitHub page: https://github.com/PDF417/pdf417-phonegap

Or another option is to generate v1 license keys that are in the correct format "8 blocks of 8 characters".

To generate v1 keys, you need to login to your account, click Generate demo license key and on step 4 select:
6.4 SDK version for Android and 5.1.2 version for iOS.

Regards

culoi commented

Hi @elmismopancho

Please let us know if you require any additional assistance. If there is no need for further assistance, please close the issue.

Regards