GetActivationMetadata() for offline


I am trying to attach metadata to each activation, it works all fine when using GetActivationMetadata() when the user is online. But GetActivationMetadata() returns UnknownError when there is no internet connection, and the license is genuinely activated during the grace period.

Is it possible to make GetActivationMetadata() available for offline? it basically saves the metadata by SetActivationMetadata() locally along with the license key, so that they can be retrieved without checking the server.

Thanks in advance,


Yes, your understanding regarding the SetActivationMetadata() is correct, So It is possible to make GetActivationMetadata() available for offline activations. Please update the LexActivator library to the latest version.


Hi Ahmad,

Thanks for your reply, I just updated to 3.17.2.

I got an exception with GetActivationMetadata() while turning off the internet, and GetLicenseKey() works all fine. Is it possible to know what does “Unknown error!” mean here?

What is the status returned by the IsLicenseGenuine()? Please share the code in the exception.

Hi @ahmad-kemsan,

Am I understanding this correctly:
For hosted floating license, GetActivationMetadata() only works offline when it is within leaseDuration, and it doesn’t matter how long the “Server Sync Grace Period” was set?
For example: if leaseDuration is set to 1 hour, and “Server Sync Grace Period” is set to 3 days, GetActivationMetadata() is only available for 1 hour for offline, and it would throw an exception after that, even within 3-day “Server Sync Grace Period”, right?

Thanks again.


Yes, your understanding regarding GetActivationMetadata() in the case of hosted floating licenses is correct, i.e GetActivationMetadata() only works offline when it is within lease duration and does not depend on the “Server Sync Grace Period”.

Thanks @ahmad-kemsan,

In our case, we set the “lease duration” to 1 hour, and we would like to automatically re-activate the license after the “lease duration” as long as the validity of the license key is still valid. So users don’t have to input the license key every time after the “lease duration”. This can be done by calling LexActivator.ActivateLicense() after a failed LexActivator.IsLicenseGenuine() check.

The problem is: for each activation, we also want to attach some metadata, which we can get from users at the first time of activation. And we want to use the same metadata for the following auto-reactivation every time, without asking the user to input the metadata again.

Is it possible to make GetActivationMetadata() work after the “lease duration”, as the same as GetLicenseKey()? So that we can use the same metadata for a new re-activation with the same license key.

Or is there any “Reactivation” function that we could use that automatically uses the same license key and all other metadata from the previous activation?

Thanks again

You are welcome!

When the application is running and the server sync occurs successfully the lease gets renewed automatically. Make sure server sync interval is less than lease duration by at least 10 seconds, as server sync is responsible for license renewal.

Activation metadata is a part of activation which means if the activation is removed the data associated with it is removed too. You can store activation metadata locally by your application so that users do not have to enter the data again.