How do I send an SMS on iOS without having to get the user to ok it?

前端 未结 3 1574
鱼传尺愫
鱼传尺愫 2021-01-26 06:11

How can I send a text message (natively or through the use of an API) from an iOS application to someone without having them have to interact with the message before hand?

相关标签:
3条回答
  • 2021-01-26 06:36

    Yes, it is possible. But you would have to use a 3rd party service to send the text message. for example, Twilio.

    0 讨论(0)
  • 2021-01-26 06:52

    Sorry, but you can't, it is completely impossible. The only way to send sms is through messageUI, which always requires the users consent. You can probably do it on a jailbroken phone, though.

    0 讨论(0)
  • 2021-01-26 06:57

    You can't do that. You need to show the user the message in the MFMessageComposeViewController that pops up first, and he has to send it by himself.

    This restriction was made, because otherwise, many apps could spam your contacts etc. with a massive amount of sms or they could even write sms to expensive numbers.

    But if you want to send just some kind of notification to another user, you could use push notifications. To do that, I would recommend you to use parse.com and their free push notification-service. Also, because Push Notifications are free, in contrast to SMS, you will save a lot of money. Of course you need to make some preparations before you can send notifications, but that way you could do it. But also there are restrictions. One restriction is, that the receiver of the notification also must have the app installed on the receiving device.

    So the receiver would receive a "message" like that:

    enter image description here

    So I would recommend you to check the QuickStart Guide from Parse.com for iOS for further informations. The Guide is really simple and shows you step by step how to activate your app for Push notifications.

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