getOfflineDeactivationRequestBlob static method
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
- A tuple containing:
- GemError: Result code describing the outcome. Possible GemError values:
- GemError.success: The request blob string is returned.
- GemError.invalidInput: The input is invalid. Check the return string for details.
- GemError.io: Something went wrong when interacting with the license file from disk.
- GemError.missingCapability: The activation API is not available on this platform/SDK build.
- String: The request blob, or the failure details.
- GemError: Result code describing the outcome. Possible GemError values:
Also see:
- completeOfflineDeactivation - Finalize the offline deactivation ceremony.
- getOfflineActivationRequestBlob - The activation counterpart.
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'],
);
}