LicenseManager

After completing SDK Initialization, there are a number of methods and objects available to the app developer.

getCurrent()

In case no active license is available the property value will be null.

License currentLicense = licenseManager.getCurrent();

getTrialLicense(String email)

You can generate a trial key directly from the app using the SDK, which will automatically associate this license key with the provided email. You can later use this data from the LicenseSpring platform to send out email campaigns targeting trial users for example.

triangle-exclamation
try {
  UnactivatedTrialLicense trial = licenseManager.getTrialLicense("[email protected]");
  License license = licenseManager.activateLicense(trial.createIdentity());
}
catch(LicenseSpringException e)
{
  log.error("Something went wrong",e);
  return;
}

activateLicenseKey(ActivationLicense identity)

Attempts to activate the product using provided ActivationIdentity. Returns the License object that has been activated.

deactivateLicense(LicenseIdentity identity)

License is deactivated using a method on the Manager. You need to supply the current license identity.

getInstallationFile(LicenseIdentity identity)

Returns the latest valid installation file, if installation files are defined in the LicenseSpring platform. For more details please see Product Versioning

getVersions(LicenseIdentity identity)

Returns all available versions of the product app that are specified in LicenseSpring platform. For more details please see Product Versioning. Version class only contains String version.

trackVariables(LicenseIdentity identity, Map<String, String> variables)

Tracks device based variables for end uses. Can use the Variable builder as a utility.

getProduct()

Gets product details from LicenseSpring servers.

getAirGapActivationCode

Gets the activation code used for air-gapped license.

Needs the LicenseSpringConfiguration field: airGappedPublicKey to work with Air Gap Licenses.

activateAirGapResponse

Activates the air-gapped license from the license policy file.

Needs the LicenseSpringConfiguration field: airGappedPublicKey to work with Air Gap Licenses.

verifyAirGapConfirmationCode

Verifies the confirmation code for air-gapped license.

Needs the LicenseSpringConfiguration field: airGappedPublicKey to work with Air Gap Licences.

Was this helpful?