- Home /
How to use Application.OpenUrl("sms") for multiple numbers?
I have been looking around how to send a message for mobile devices through the OpenUrl("sms:") method and can't seem to figure out how to send to multiple phone numbers... I am trying on an iPhone with iOS 8.1.2 and I'm currently using
Application.OpenURL(string.Format("sms:{0}&body={1}", number, WWW.EscapeURL(message)));
Also, how can I get the message in there without using WWW.EscapeURL())? Every time I use this it gives me a "+" in between each space. But if I remove the WWW.EscapeURL() then it doesn't start the message sending.
Thanks in advanced!
Answer by Umresh · Jan 07, 2015 at 07:21 AM
Try this:
Application.OpenURL(string.Format("sms:123,456?body=Hello"));
No, this still does not work. It only adds the first number to the recipient list
I'm right with d34thst4lker, it doesn't works for me too. Is anyone found a solution ?
Answer by liortal · Aug 20, 2016 at 03:25 PM
I am not sure this is possible by using the "sms:" URL scheme.
What you can do is implement this as a plugin in native iOS code (check out the MFMessageComposeViewController class).
Here's a tutorial that shows the code needed to start the SMS app with the requested recipients: http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/
If you require other platforms, you'll have to implement it for every platform your game has to run on.
Thanks for those links liortal. I took time to read it a bit and I switch to that one: https://developer.apple.com/library/ios/documentation/$$anonymous$$essageUI/Reference/$$anonymous$$F$$anonymous$$essageComposeViewController_class/index.html#//apple_ref/occ/instp/$$anonymous$$F$$anonymous$$essageComposeViewController/recipients They says
If you want to provide an initial array of one or more recipients for a message, do so before you display it. After the message is displayed you cannot change the value of this property.
So I think that's possible, I just think that I'm not using the good way :)
What you think ?
I just found this that worked for me :
"sms:/open?addresses=1-408-555-1212,1-408-555-2121,1-408-555-1221&body=/*message*/"
Your answer
Follow this Question
Related Questions
Is it possible to send SMS from an action in Unity? (Mobile iOS or Android) 1 Answer
Using the Volume Control Buttons On Mobile Devices 0 Answers
Scriptable object doesn't load in the build of the project 1 Answer
Native list views on Mobile? 0 Answers
Is it possible to send an SMS without opening SMS Composer? (Android) 3 Answers