getOfflineActivationRequestBlob static method

(GemError, String) getOfflineActivationRequestBlob({
  1. required String applicationId,
  2. String licenseKey = '',
  3. String productId = ProductID.core,
})

Generates the offline activation request blob, the first step of the offline activation ceremony.

Runs entirely on-device with no network access. Take the returned blob to the licensing portal, obtain the offline_activation_key, then finalize with completeOfflineActivation.

Parameters

  • applicationId: The application id the activation is bound to.
  • licenseKey: The license key. Optional: if left empty, the SDK generates one. Retrieve the key in use via getActivationsForProduct.
  • productId: The kind of product to activate. Defaults to ProductID.core.

Returns

Also see:

Implementation

static (GemError, String) getOfflineActivationRequestBlob({
  required String applicationId,
  String licenseKey = '',
  String productId = ProductID.core,
}) {
  final OperationResult resultString = staticMethod(
    'ActivationService',
    'getOfflineActivationRequestBlob',
    args: <String, String>{
      'applicationId': applicationId,
      'licenseKey': licenseKey,
      'productId': productId,
    },
  );

  if (resultString['gemApiError'] == GemError.missingCapability.code) {
    return (
      GemError.missingCapability,
      'Activation API is not available. Please check if your SDK build includes the activation capability and contact Magic Lane support for assistance.',
    );
  }

  return (
    GemErrorExtension.fromCode(resultString['result']['first']),
    resultString['result']['second'],
  );
}