activateLicense method
Applies the web license. The web SDK takes its license once, when it is first initialised, so call this before any imaging call; afterwards a different license cannot be applied until the page reloads.
The SDK accepts any license here and only watermarks its output when the
license is invalid, so true means "applied", not "verified".
Implementation
@override
Future<bool?> activateLicense(
{String? android, String? ios, String? web}) async {
if (web == null) {
if (kDebugMode) {
debugPrint('License key for the web platform is not available');
}
return false;
}
if (_sdkInit != null) {
final sameLicense = _initLicense == web;
if (!sameLicense && kDebugMode) {
debugPrint('The web SDK is already initialised; a new license applies only '
'after the page reloads. Call activateLicense before any imaging call.');
}
return sameLicense && await _sdkInit!;
}
return _initSdk(web);
}