Skip to content

Updating the license#

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

In LUNA ID for Android#

To dynamically update the license, pass the license file to the LunaID.initEngine method. Below is an example:

val config = LunaConfig.create(
    // other configuration options...
)

LunaID.initEngine(
        app: Application,
        lunaConfig: LunaConfig,
        apiHumanConfig: ApiHumanConfig? = null,
        license : File? = null,
        timeoutMillis : Long = 30_000L
    )
Key components of the example code

The example code has the following components:

Component Description
lunaConfig An argument to be passed for best shot parameters.
license An instance of java.io.File. If this parameter is not provided, the system will use the default license.conf file located in the project.
timeoutMillis The timeout for license activation, with a default value of 30 seconds (30,000 milliseconds).

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.