Home > @magiclane/maps-sdk > ActivationService

ActivationService class

Service for activating and managing product licenses for the Magic Lane SDK.

Used in Magic Lane products. Provides methods to generate license keys, activate and deactivate products, complete online/offline activation flows, query activation state and list activations present on the device.

Activation

Signature:

export declare abstract class ActivationService 

Methods

Method

Modifiers

Description

activate({ applicationId, licenseKey, productId, onComplete, }, input)

static

Activates a product using the supplied license key.

Starts an activation flow for productId using licenseKey (a UUID v4). The operation is asynchronous and the onComplete callback reports final status and a hint string with supplemental information.

completeActivation(activationResponseBlob)

static

Completes an activation that required an extra manual step.

Used when the activation flow required an out-of-band/manual request. Pass the activationResponseBlob obtained from the manual activation service call to finalize the activation locally.

This method is used to complete activations that could not be completed in a single call, for example when manual verification or additional authentication steps are required.

completeOfflineActivation(offlineActivationKey)

static

Activates a product offline using the offline activation key.

Finalizes an offline activation flow where the activation service returned a short offlineActivationKey.

deactivate({ applicationId, licenseKey, productId, onComplete, }, input)

static

Deactivates a product previously activated with a license key.

Initiates a deactivation request for licenseKey and productId. The asynchronous onComplete callback reports the final result and a hint string explaining errors or next steps.

Do not confuse deactivation with deletion of an activation record on the device. Deactivation notifies the activation service that the license is no longer in use on this device, allowing it to be reactivated elsewhere if the license terms permit. Deletion simply removes the activation record locally without notifying the activation service.

After deactivation, the ActivationInfo.status of the corresponding activation will be updated to reflect the deactivated state.

deleteActivation(activationId)

static

Deletes an activation entry identified by its id.

Do not confuse deactivation with deletion of an activation record on the device. Deactivation notifies the activation service that the license is no longer in use on this device. Deletion simply removes the activation record locally without notifying the activation service.

generateLicenseKey({ applicationId, productId, onComplete, }, input)

static

Generates a new license key for the provided application and product.

Requests a license key from the remote activation service for the given applicationId and optional productId. The operation is asynchronous and progress/results are delivered via the onComplete callback.

The generated license key is a UUID v4 string that uniquely identifies the license for activation purposes.

getActivationsForProduct(productId)

static

Returns activations found for the specified product.

Retrieves a list of ActivationInfo objects representing activations for productId that are stored on this device.

getProductIds(includeExpired)

static

Returns the product identifiers found on the device.

isActive(productId)

static

Checks whether the given product is currently active on the device.