Skip to content

Updating the license#

This topic explains how to dynamically update the license in LUNA ID.

In LUNA ID for Android#

You can dynamically update the license by passing the following instance of LicenseParams into LunaConfig.create() before calling LunaID.initEngine(config). For example:

val config = LunaConfig.create(
    // other configuration options...
    licenseParams = LicenseParams(
        server = "https://example-license-server.com",
        eId = "your_new_eid",
        productId = "your_new_product_id",
        licenseModel = LicenseModel.ZEUS
    )
)

LunaID.initEngine(config)

The LicenseParams class has the following fields:

Field Description
server URL of the license activation server.
eId Entitlement ID assigned by VisionLabs for license validation.
productId Product ID associated with your specific project.
licenseModel License model type:
  • LicenseModel.FIT
  • LicenseModel.ZEUS
  • Important notes:

    • The license must be updated before initializing LUNA ID.
    • If changes are made after initialization, you must restart the app or re-initialize the engine with the new configuration.

    In LUNA ID for iOS#

    You can dynamically update the license using the LCLicenseConfig class. Populate its fields with the required data and pass it during the initialization of the LUNA ID engine.

    Important: The responsibility for providing the required license data lies with the client application, which retrieves the values from its server and populates the fields of the configuration class.

    Below is an example of how to configure and populate LCLicenseConfig class:

    var newConfig = LunaCore.LCLicenseConfig()
    newConfig.eid = "your_entitlement_id"
    newConfig.productID = "your_product_id"
    

    These values are then passed to the LunaConfig object during engine initialization:

    let config = LCLunaConfiguration()
    config.licenseConfig = newConfig
    
    LunaID.initEngine(config)