简体   繁体   中英

How to programatically choose which sim from a dual sim iPhone to send sms?

I am using MFMessageComposeViewController for loading SMS content. But it takes the default number for sending the SMS.

Can I change the default number programatically like, Choose Sim 1 or Sim 2

from within the app without depending on iPhone settings?

Currently the code for using MFMessageComposeViewController is as given below:

     - (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];
 }
}

This works fine If I am using a single sim iPhone but since there are dual sim iPhones too is it possible to programmatically choose between "SIM 1" and "SIM 2" within the application for sending the message without going to the iPhone Settings?. Any ideas will be highly appreciated

Not sure if the OP has an answer or not. Anyway, for your reference, in jailbreak community, there is a tweak named eSim+. It can provide option SIM1 or SIM2 for call or sms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM