License Class

  • License
  • class Esri::ArcGISRuntime::License

    Details of license. 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 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. You can get one by calling Portal::fetchLicenseInfo. Pass the LicenseInfo to ArcGISRuntimeEnvironment::setLicense(const Esri::ArcGISRuntime::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 ArcGISRuntimeEnvironment::setLicense(const Esri::ArcGISRuntime::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).

    Member Function Documentation

    [override virtual] License::~License()

    Destructor

    QDateTime License::expiry() const

    Returns license expiry date and time in UTC.

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

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

    Returns the collection of extension licenses for the app.

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

    Note that, although this collection is empty when running an app in developer mode, all extension licensed functionality will be available.

    See also ExtensionLicense.

    bool License::isPermanent() const

    Returns 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.

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

    Returns 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.

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

    Returns the current license status of the provided license.

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

    Returns 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).

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