How to start the SMS Message app
I want to open SMS Message app to copy text from friends. I am not creating SMS.
How to launch iphone SMS Message app using Swift code? I find this code below to launch Mail app but doesn't work.
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: @ "mailto:"]];
I changed it and didn't work
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: @ "sms:"]];
appreciate your help. TIA
+4
source to share
3 answers
I'm not sure why you want to explicitly use the SMS app, and I'm not sure if this is possible. On the other hand, iOS offers by default MFMessageComposeViewController
to send SMS from the iOS app.
Check this example for more details.
Edit: I found this wiki page that may contain an answer to your question. Please be aware that I have not tested it.
let number = "sms:+12345678901"
UIApplication.sharedApplication().openURL(NSURL(string: number)!)
+3
source to share