License Class

  • License
  • class Esri::ArcGISRuntime::License

    ArcGIS Maps SDK license information. More...

    Header: #include <License.h>
    Since: Esri::ArcGISRuntime 100.0
    Inherits: Esri::ArcGISRuntime::Object

    Public Functions

    virtual ~License() override
    QDateTime expiry() const
    QList<Esri::ArcGISRuntime::ExtensionLicense> extensions() const
    bool isPermanent() const
    Esri::ArcGISRuntime::LicenseLevel licenseLevel() const
    Esri::ArcGISRuntime::LicenseStatus licenseStatus() const
    Esri::ArcGISRuntime::LicenseType licenseType() const

    Detailed Description

    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 ArcGISRuntimeEnvironment::setLicense(const QString&) 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, licenseLevel(), 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 ArcGISRuntimeEnvironment::setLicense(const QString&).

    To validate with information from a portal, you need a LicenseInfo instance. Obtain one by calling PortalInfo::licenseInfo(). Pass the LicenseInfo to ArcGISRuntimeEnvironment::setLicense(const LicenseInfo&).

    Both of these methods return a LicenseResult indicating the result from applying 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 ArcGISRuntimeEnvironment::setLicense(const LicenseInfo&) returns a LicenseResult which contains license status of LicenseStatus::LoginRequired, and the app continues to run at the current license level (LicenseLevel::Developer by default).

    Member Function Documentation

    [override virtual] License::~License()

    Destructor

    QDateTime License::expiry() const

    Returns the license expiry date and time in UTC.

    This method gets either the expiry date of a license set with ArcGISRuntimeEnvironment::setLicense(const QString&) or the portal subscription expiry when using ArcGISRuntimeEnvironment::setLicense(const LicenseInfo&).

    QList<Esri::ArcGISRuntime::ExtensionLicense> License::extensions() const

    Returns a list of extension licenses that were applied to the app.

    For valid extension license keys supplied when calling ArcGISRuntimeEnvironment::setLicense(const QString&, const QStringList&), this list is populated with information about the extension license. Use this function to iterate through extension licenses that are available in the app environment.

    All extension licensed functionality is available when the app is running in Developer mode. This list will return empty if this is the case, but you will be able to access all functionality while the view displays a watermark.

    See also ExtensionLicense.

    bool License::isPermanent() const

    Returns whether a license is perpetual or not.

    Typically this returns true for a license string with 'none' for the expiration date field.

    Esri::ArcGISRuntime::LicenseLevel License::licenseLevel() const

    Returns the current license level set in the app. The current license level may be Developer, Lite, Basic, Standard, or Advanced.

    By default, when an app is launched it runs at the Developer level until a deployment license has been provided.

    Esri::ArcGISRuntime::LicenseStatus License::licenseStatus() const

    Returns the license status for the current license applied to the app.

    Usually this status returns Valid because the current License object always contains the most current valid license.

    Esri::ArcGISRuntime::LicenseType License::licenseType() const

    Returns the current license type for the license applied to the app.

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

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.