IsLicenseGenuine() periodically invokes the server sync and when the server sync is completed, it invokes the licenseCallback. Please make sure the callback function is defined before ActivateLicense().
It’s already defined before calling ActivateLicense() and it’s also never been invoked,
kindly check the snippet
function licenseCallback(status) {
console.log('Invoked!');
try {
switch (status) {
case LexStatusCodes.LA_EXPIRED:
case LexStatusCodes.LA_SUSPENDED:
console.log('License is genuinely activated but has expired!', status);
throw new Error(status);
case LexStatusCodes.LA_OK:
console.log('License is genuinely activated!', status);
break;
default:
throw new LexActivatorException(status);
}
} catch (error) {
console.log(error.code, error.message);
}
}
init();
LexActivator.SetLicenseCallback(licenseCallback);
activate();
const status = LexActivator.IsLicenseGenuine();
Please remove the activate function in your code. It is only needed once. When you remove this function then IsLicenseGenuine() will trigger the callback in few seconds.
But we use the floating licence in docker containers, hence the activate must be called every time a docker container is created.
As I know this is the idea of a floating licence, every app instance calls activate() to activate its licence, and I’m following the github example which already call activate(), IsLicenseGenuine() and SetLicenseCallback()
We are on the trial now and want to use Cryptlex to be our licensing solution and need to finalize this issue before buying the subscription and go production.
Please try to run the sample attached below to see if the callback gets triggered:
Note: All the necessary information is hardcoded. You only need to run the sample code and wait for the time till the server sync gets completed which in this example is set to be equal to 180 sec.