License

class License

Details of license. Until an app is licensed, it runs at the Developer license level. All functionality is available, but the map display is watermarked and a message is logged stating that the app is in developer mode.

A deployed app needs to be run at minimum with the Lite license level to disable the map watermark. The Lite, Basic, Standard, or Advanced license level is set by calling ArcGISEnvironment.setLicense(String) with a license string obtained from the ArcGIS for Developers website or Esri Customer Service. With the varying license levels, a subset of functionality is available. Any attempt to use licensed functionality that is not available at the current license level will log or emit error messages.

To get Lite, Basic, Standard, or Advanced license level functionality, a user app is licensed in one of two ways:

  • With license information retrieved after logging in to a portal (Lite and Basic levels).

  • With a license string acquired from the ArcGIS for Developers website or Esri Customer Service.

To license with a license string, call ArcGISEnvironment.setLicense(String).

To validate with information from a portal, you need a LicenseInfo instance. You can get one by calling Portal.fetchLicenseInfo(). Pass the LicenseInfo to ArcGISEnvironment.setLicense(LicenseInfo).

Both of these methods return a LicenseResult that reports the status of the license. Note that there is a 30-day timeout when using LicenseInfo. If the app is licensed using this method, the user must log in to the portal again before licensing the app. When this period has expired, calling ArcGISEnvironment.setLicense(LicenseInfo) returns a LicenseResult which contains license status of LicenseStatus.LoginRequired, and the app continues to run at the current license level (default is LicenseLevel.Developer).

Since

200.1.0

Properties

Link copied to clipboard

License expiry date and time in UTC. This is either the expiry date of a license set with ArcGISEnvironment.setLicense(String) or the portal subscription expiry when using ArcGISEnvironment.setLicense(LicenseInfo).

Link copied to clipboard

The collection of extension licenses for the app. For valid extension license keys supplied when calling ArcGISEnvironment.setLicense(String, MutableListImpl), this collection is populated with information about the extension licenses. Use this function to iterate extension licenses available for the app.

Link copied to clipboard

True if a license is perpetual, false otherwise. Typically this returns true for apps licensed with a license string with 'none' for the expiration date field.

Link copied to clipboard

The current license level set in the app. See LicenseLevel for available levels. By default, unless a deployment license is provided, apps run with a LicenseLevel.Developer license.

Link copied to clipboard

The current license status of the provided license.

Link copied to clipboard

The license type of the current license. In developer mode, this function returns LicenseType.Developer. Otherwise, it can return LicenseType.NamedUser if the app was licensed by logging in to a portal and acquiring a LicenseInfo, or LicenseType.LicenseKey if the app was licensed from a license string. The license type can change while an app runs. For instance, the app may start running licensed with a Lite license key (LicenseType.LicenseKey) and later become licensed from LicenseInfo (LicenseType.NamedUser).