installESimProfile method

  1. @override
Future<String> installESimProfile({
  1. String? smdpAddress,
  2. required String activationToken,
})
override

Implementation

@override
Future<String> installESimProfile({String? smdpAddress, required String activationToken}) async {
  final isSupported = await isSupportESim();
  if (isSupported != true) {
    throw PlatformException(
      code: 'ESIM_NOT_SUPPORTED',
      message: 'eSIM is not supported on this device',
    );
  }
  String url = "";
  if(Platform.isAndroid)url = "LPA:1\$$smdpAddress\$$activationToken";
  if(Platform.isIOS) url = "https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA:1\$$smdpAddress\$$activationToken";
  final result = await methodChannel.invokeMethod<String>('launchIntent', {'profile': url});
  return result ?? "";
}