setLicenseKey method

  1. @override
Future<int> setLicenseKey({
  1. required String licenseKey,
})
override

Sets the PortSIP license key.

Invokes the native 'setLicenseKey' method via MethodChannel.

Returns 0 on success, -1 or error code on failure.

Implementation

@override
Future<int> setLicenseKey({required String licenseKey}) async {
  final args = {'licenseKey': licenseKey};
  _logCall('setLicenseKey', args);
  try {
    final result = await methodChannel.invokeMethod<int>('setLicenseKey', args);
    _logResponse('setLicenseKey', result);
    return result ?? -1;
  } on PlatformException catch (e) {
    _logError('setLicenseKey', e);
    return -1;
  }
}