-3

Is it possible to send an automatic text message to a preset number when a UISwitch is toggled off using Swift, so that a user could be alerted if the app was disabled?

Air
  • 7,750
  • 2
  • 49
  • 84

1 Answers1

1

Short Answer

No.

Long Answer

Unfortunately it is not. Not automatically, but you can:

  1. Schedule a Local Notification with the desired frequency.
  2. When the user clicks the notification use MessageUI's MFMessageComposeViewController.

Warning: don't forget to check if the device MFMessageComposeViewController.canSendText()

To send an SMS using MFMessageComposeViewController you simply have to:

You may also want to see a question filled with great answers regarding sending text messages programatically!

Community
  • 1
  • 1
fpg1503
  • 7,381
  • 5
  • 30
  • 48