0

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:

 MFMessageCompose *controller1 = [[MFMessageCompose alloc] init] ;
 controller1 = [[MFMessageCompose alloc] init] ;
 if([MFMessageCompose 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

user16780334
  • 422
  • 5
  • 20
  • Doesn't the user choose the SIM when viewing the view controller? You cannot pre-select it but the user can choose which one to use afaik. – luk2302 Jan 13 '21 at 12:45
  • I didn't understand I mean is it possible to show a screen like CHOOSE SIM 1 or SIM 2 in my app and then send the message using MFMessageComposer using the selected SIM? – user16780334 Jan 13 '21 at 12:48
  • No............. – luk2302 Jan 13 '21 at 12:48
  • Ouhh so how can I handle the case in this scenario? Like if I want to choose SIM 2 for sending message instead of SIM 1. – user16780334 Jan 13 '21 at 12:50
  • 1
    As I said: the user will be able to choose which sim to use when the `MFMessageComposeViewController` is presented. But you will not know anything about there even being two sims or what the user decided to use. – luk2302 Jan 13 '21 at 12:52
  • I have seen an option to choose PRIMARY or SECONDARY inside the default MFMessageViewController. So as per you in iOS the only option is to first invoke MFMessageViewController then the user must choose SIM 1 or SIM 2 inside the MFMessageController and send message? Am I right? – user16780334 Jan 13 '21 at 12:52
  • I think so, yes. – luk2302 Jan 13 '21 at 12:53
  • Thanks Luke can you please add this as an answer so that I can upvote because my client is adamant of achieving something which is not allowed by the iOS.. I will be grateful to you – user16780334 Jan 13 '21 at 12:54

1 Answers1

0

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.

Tweak iOS
  • 1
  • 2