Skip to content

Licensing#

To integrate LUNA ID with your project and use its features, you need to activate the license.

License activation#

In LUNA ID for Android#

To activate the license:

1․ Request Server, EID, and ProductID from VisionLabs. For details, see License parameters.

2․ Specify the received parameters in the license.conf file and save the changes.

3․ Place the file in the assets/data/license.conf directory of your project.

The license key will be generated and saved to the specified directory. The license file has a binary format. At the next launch of the mobile app on the same device, the license will be read from this file.

4․ Activate the license by calling the activateLicense() method:

if (LunaID.activateLicense(applicationContext)) {
    LunaID.init(
        app = this@App,
        lunaConfig = lunaConfig
    )
} else {
    Log.e("@@@@", "activation failed")
}

For a detailed example, see App.kt.

Example license file#

Below is a sample content of the "license.conf" file:

<?xml version="1.0"?>
<settings>
        <section name="Licensing::Settings">
                <param name="Server" type="Value::String" text=""/>
                <param name="EID" type="Value::String" text=""/>
                <param name="ProductID" type="Value::String" text=""/>
                <param name="Filename" type="Value::String" text="license.dat"/>
                <param name="ContainerMode" type="Value::Int1" x="0"/>
                <param name="ConnectionTimeout" type="Value::Int1" x="15"/>
        </section>
</settings>

In LUNA ID for iOS#

Important: Starting from v.1.7.2, you need to define the license in your final app in the "vllicense.plist" file. The "data/license.conf" file must remain empty.

To activate the license:

1․ Request Server, EID, and ProductID from VisionLabs. For details, see License parameters.

2․ Specify the received parameters in the "vllicense.plist" file and save the changes.

3․ Add the file to your final app.

The license key will be generated and saved to the specified directory. The license file has a binary format. At the next launch of the mobile app on the same device, the license will be read from this file.

You can optionally rename the "vllicense.plist" file. To do this, change the default value, which is vllicense.plist, of the LCLunaConfiguration::plistLicenseFileName property.

Example license file#

Below is a sample content of the "vllicense.plist" file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Server</key>
    <string></string>
    <key>ProductID</key>
    <string></string>
    <key>EID</key>
    <string></string>
    <key>ContainerMode</key>
    <real></real>
    <key>ConnectionTimeout</key>
    <integer></integer>
    <key>Filename</key>
    <string>license.dat</string>
</dict>
</plist>

License parameters#

License parameters and further processing requires the following parameter:

Parameter Description Type Default value Required
Server Activation server URL String Not set Yes
EID Entitlement ID String Not set Yes
ProductID Product ID String Not set Yes
Filename The default name of the file to save the license to after activation. The maximum length of the file name is 64 symbols. We do not recommend that you change this name. String Not set No
ContainerMode If run in container. Real 0 No
ConnectionTimeout The maximum time, in seconds, for the transfer operation to take. Setting the timeout to 0 means that it never times out during transfer. You can't set the parameter to a negative value. The maximum value is 300 seconds. Integer 15 No