Send SMS programmatically, without the SMS composer window

后端 未结 6 1466
我在风中等你
我在风中等你 2021-02-01 07:32

Until yesterday I thought that it was not possible to send background SMS without using the IOS SMS interface (Which many people here assure also). However, today I downloaded a

相关标签:
6条回答
  • 2021-02-01 08:03

    You can not send SMS programmatically in background, you can use following third party API to send the text message (SMS).

    1. http://www.twilio.com/
    2. http://www.nexmo.com/
    3. https://www.tropo.com/

    I would suggest nexmo, its easy to use and support international messages also.

    0 讨论(0)
  • 2021-02-01 08:03

    You can use:

    [[UIApplication sharedApplication] openURL: @"sms:+3912345678"];
    

    it doesn't work on simulator... and you cannot send programmatically sms!

    Tested on iOS < 6.

    0 讨论(0)
  • 2021-02-01 08:15

    I've been looking into the SMS send/receive limitation on iOS for a few days, using iOS 6 and XCode 4.5 (latest as of writing). I was curious about this SmartSender application so I purchased it.

    I don't know if it's because I only tried it on iOS 6, but I get the standard message controller (MFMessageComposeViewController) to send messages. I have tried delayed send - I get the message controller at prescribed time and have to manually click on Send. I have tried immediate send - that pops up the controller and I also have to manually click on Send. If I click on Cancel, the app actually loops me back into the message controller (I can't cancel unless I kill the app!)

    So true, this allows entering messages from a custom UI, but then the message itself is copied into the MFMessageComposeViewController and that is what sends the SMS. So App Store approved, but nothing like what we're all looking for!

    0 讨论(0)
  • 2021-02-01 08:21

    Having tried the app, I can verify that it does send SMS programmatically, without showing the SMS interface. And it clearly doesn't happen through a third-party service, since the message gets sent as an iMessage when possible.

    It's also clear from all the other answers that there aren't any public APIs for sending SMS programmatically, so the developer must have used a private API and yet somehow snuck this app through the approval process.

    Specifically, it seems he used the CoreTelephony API. This post on SO describes the procedure. Apparently you'll also need to get your hands on the CoreTelephony header files somewhere.

    0 讨论(0)
  • 2021-02-01 08:27

    In fact it is not possible; however it was when the question was answered.

    The App in question has now specified in its description that it won't work under IOS 6, so I think apple patched some bug that could be exploited to achieve this functionality.

    0 讨论(0)
  • 2021-02-01 08:28

    There is no way to send SMS programmatically. You may want to investigate a 3rd party service service for sending SMS like Twilio.

    0 讨论(0)
提交回复
热议问题