GetLicenseMetadata returns status 1 (LA_FAIL)


#1

When I request a metadata field in C++ (I have verified that it exists for the license key that I have set), the status code is 1 (LA_FAIL according to the header) and the char array is not populated.

status = SetLicenseKey(key);

(status is 0)

char my_metadata_value[20];
status = GetLicenseMetadata("my_metadata_key", my_metadata_value, 20);

(status is 1)

I am on a Linux system.

Do you know why this may be happening?


#2

Hi,

Before calling GetLicenseMetadata () you have to ensure that license is activated. LA_FAIL simply means license is not activated yet. So, the metadata will be available after ActivateLicense () function succeeds.


#3

Hi Adnan,

If this is the case, this would mean that I cannot examine the license metadata in order to determine whether or not I should allow activation to proceed. For example, I would like a license to have a maximum version number. A license for version <=1.4 should not activate if the software is version 1.5. You seemed to indicate here that license metadata is the way to do this. Do you have any ideas about how I can implement this if I cannot access license metadata before activating?


#4

Hi,

If your customer has a license key, the customer can activate the license, but whether you want to allow your customer to use the app, is your decision by checking the value of metadata key say (max_allowed_version) post license activation.

After checking the metadata, you call also call DeactivateLicense() if needed.


#5

Hi,
related to checking the metadata for a version string… For customers that activate online is there a way to keep a response_file that contains encrypted metadata so that subsequent runs do not require internet access to check the metadata?

Thanks


#6

Hi,

Calling GetLicenseMetadata () doesn’t make a network call, only ActivateLicense () and ActivateTrial () functions make a synchronous network call, and IsLicenseGenuine () makes an asynchronous network call in a background thread.

When you activate the license, all the metadata information is fetched at that time and stored on disk in an encrypted form. IsLicenseGenuine () makes sure that the data stored on disk is always in sync with the server, by doing periodic server syncs in a background thread. If there is no network available, it keeps on making attempts on each cycle.