installFromActivationCode method

  1. @override
Future<InstallResult> installFromActivationCode(
  1. String activationCode
)
override

Installs a profile using an activation code (e.g., SM-DP+ activation code or QR content depending on platform).

Implementation

@override
Future<InstallResult> installFromActivationCode(String activationCode) async {
  try {
    final result = await methodChannel.invokeMethod<Map<dynamic, dynamic>>(
      'installFromActivationCode',
      <String, dynamic>{'activationCode': activationCode},
    );
    if (result == null) return InstallResult(status: InstallStatus.failed, message: 'No response from platform');
    return InstallResult.fromMap(result);
  } on PlatformException catch (e) {
    return InstallResult(status: InstallStatus.failed, message: e.message ?? e.code);
  }
}