License

The basic LicenseSpring object you will be working with is the License object.

It has the following properties available:

  • licenseKey: License key. Exists for key-based license
  • user: License user. Exists for user-based license
  • productCode: Product code
  • licenseType: Type of license (LicenseType)
  • customer: Information about license customer, commonly it’s a person or organization associated with the license.
  • validityPeriod: Period when the license is valid.
  • maintenancePeriod: Maintenance period for the license.
  • startDate: The first date when the license can be activated
  • lastSyncDate: The date of the last sync with the LicenseSpring platform
  • isTrial: If license is trial
  • isActive: If license is active
  • isEnabled: If license is enabled
  • isOfflineActivated: If license was activated offline
  • installationFile: Installation information related to the license Note: To get actual installation file information, call synchronize method first
  • hardwareID: Hardware ID related to the license
  • state: Current state of the license (LicenseState)
  • isExpired: If license have been expired
  • isUnlicensedCopy: If license copy is unlicensed

deactivate

This method will deactivate the license on current computer. It can be then reactivated on the same computer, or on a different computer or device.

guard let license = licenseManager.currentLicense else { return }
try license.deactivate()

fullCheck

Checks the license for validity on the LicenseSpring platform.

guard let license = licenseManager.currentLicense else { return }
do {
    try license.fullCheck()
} catch {
    print("License is not valid")
}

localCheck

Check license for validity offline.

guard let license = licenseManager.currentLicense else { return }
do {
    try license.localCheck()
} catch {
    print("License is not valid")
}