getOfflineActivationRequestBlob static method
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
- 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:
- completeOfflineActivation - Finalize the offline activation ceremony.
- getOfflineDeactivationRequestBlob - The deactivation counterpart.
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'],
);
}