简体   繁体   English

如何以编程方式从双卡 iPhone 中选择哪个 sim 卡发送短信?

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

I am using MFMessageComposeViewController for loading SMS content.我正在使用 MFMessageComposeViewController 来加载 SMS 内容。 But it takes the default number for sending the SMS.但它需要发送短信的默认号码。

Can I change the default number programatically like, Choose Sim 1 or Sim 2我可以以编程方式更改默认数字吗,例如选择 Sim 1 或 Sim 2

from within the app without depending on iPhone settings?从应用程序内部而不依赖于 iPhone 设置?

Currently the code for using MFMessageComposeViewController is as given below:目前使用MFMessageComposeViewController的代码如下:

     - (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?.这很好用如果我使用的是单卡 iPhone,但由于也有双卡 iPhone,是否可以在应用程序中以编程方式在“SIM 1”和“SIM 2”之间进行选择,以便在不转到 iPhone 设置的情况下发送消息? Any ideas will be highly appreciated任何想法将不胜感激

Not sure if the OP has an answer or not.不确定OP是否有答案。 Anyway, for your reference, in jailbreak community, there is a tweak named eSim+.无论如何,供您参考,在越狱社区中,有一个名为 eSim+ 的调整。 It can provide option SIM1 or SIM2 for call or sms.它可以提供用于通话或短信的选项 SIM1 或 SIM2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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