title: iOS : Check whether the phone is dual SIM?
body: <p>In Android we can detect whether the phone is Single SIM or Dual SIM. And as we know iPhone XS, iPhone XS Max, iPhone XR, and later feature Dual SIM with a nano-SIM and an eSIM except china mainland where there is no eSIM.</p>
  <p>A) I can programatically invoke <code>MFMessageComposeViewController</code>
  from a button click to send the SMS to a particular number. Here is
  the following code: This code can tell us whether the SIM is
  inserted or not. But will it work for eSIM too?</p>
  <pre><code>-(void)openMessageViewWithName:(NSString*)contactName withPhone:(NSString *)phone{
  
  CTTelephonyNetworkInfo *networkInfo=[[CTTelephonyNetworkInfo alloc]init];
  
  CTCarrier *carrier=networkInfo.subscriberCellularProvider;
  
  NSString *Countrycode = carrier.isoCountryCode;
  
  if ([Countrycode length]&gt;0)     //Check If Sim Inserted
  {
  
      [self sendSMS:msg recipientList:[NSMutableArray arrayWithObject:phone]];
  }
  else
  {
  
      [AlertHelper showAlert:@&quot;Message&quot; withMessage:@&quot;No sim card inserted&quot;];
  }
  </code></pre>
  <p>//Method for sending message:</p>
  <pre><code>   - (void)sendSMS:(NSString *)bodyOfMessage recipientList:(NSMutableArray *)recipients{  
   MFMessageComposeViewController *controller1 = [[MFMessageComposeViewController alloc] init] ;
   controller1 = [[MFMessageComposeViewController alloc] init] ;
   if([MFMessageComposeViewController canSendText])
  {
      controller1.body = bodyOfMessage;
      controller1.recipients = recipients;
      controller1.messageComposeDelegate = self;
      [self presentViewController:controller1 animated:YES completion:Nil];
   }
  }
  </code></pre>
  <p>B) Is it possible to determine whether my iPhone is Dual SIM or Single SIM programatically? If yes it is DUAL SIM then can we choose the SIM from my application to send the SMS ?</p>
  <p>Please help me with these and help me with a workaround .</p>