getOfflineDeactivationRequestBlob static method

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

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

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

Parameters

  • applicationId: The application id the activation is bound to.
  • licenseKey: The license key of the activation to release. If it was generated by the SDK during activation, read it back via getActivationsForProduct.
  • productId: The kind of product to deactivate. Defaults to ProductID.core.

Returns

Also see:

Implementation

static (GemError, String) getOfflineDeactivationRequestBlob({
  required String applicationId,
  required String licenseKey,
  String productId = ProductID.core,
}) {
  final OperationResult resultString = staticMethod(
    'ActivationService',
    'getOfflineDeactivationRequestBlob',
    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'],
  );
}