I know how to send the SMS with Swift (using MFMessageComposeViewController
). But what I am wondering is
how does it work? Where is the message coming from? And who pays the SMS?
Asked
Active
Viewed 70 times
1 Answers
1
The SMS is sent and charged by your phone provider. If the person you're sending it to has iMessage, it's free and handled by Apple.

Filipe Sá
- 372
- 1
- 5
- 15
-
But it doesn't make sense. If the user enter a phone number (example : XXX YYY WWWW), the app has no acess to the user's phone number (example : http://stackoverflow.com/a/39849652/7010252), but it still sends a SMS to XXX YYY WWWW – l.b.dev Nov 03 '16 at 20:18
-
It's just like when you send a message from the messages app. If the number is wrong it fails to send or deliver – Filipe Sá Nov 03 '16 at 20:21
-
So this http://stackoverflow.com/a/39849652/7010252 wouldn't work ? Moreover if the code in the link works where is the user's phone number? – l.b.dev Nov 03 '16 at 20:27
-
It works. It prompts a view just like when you compose a new message on the native app. You can pre set the recipients like this: controller.recipients = [phoneNumber] (right there on the code) – Filipe Sá Nov 03 '16 at 20:32
-
yeah but for your friend number not your own number, right? – l.b.dev Nov 03 '16 at 20:34
-
Exactly. your own number depends on the SIM card you have on the phone, you can't fake it – Filipe Sá Nov 03 '16 at 20:36