Reputation: 6610
We are trying to create a hyperlink in HTML page which should open predefined SMS - when user taps this link on our page, SMS app should open up with predefined number and body. We were able to successufully set the number, but we are unable to set body of this text message. Is it possible?
The link we are so far trying is :
<a href="sms:123456789?body=sometext">sms link</a>
Thanks a lot for help!
Upvotes: 6
Views: 19309
Reputation: 1521
For iOS 8:
<a href="sms:123456789&body=sometext">sms link</a>
i customizing while removing the phone number 1234... so user can input the number of their choice in order to share links of my app
Upvotes: 10
Reputation: 71
At the moment I got these situations working:
works on iOS 8 (have not tested iOS 7):
<a href="sms:123456879&body=bodytext">Send sms</a>
works on Android 4.x, NOT ON 5.x
<a href="sms:123456879?body=bodytext">Send sms</a>
I have also tested smsto but that did not matter to make it work on Android 5
Check this fiddle to test:
https://jsfiddle.net/w4vcyjfw/14/
Upvotes: 7
Reputation: 107231
No, it is not possible.
The sms scheme is used to launch the Messages app. The format for URLs of this type is “sms:”, where is an optional parameter that specifies the target phone number of the SMS message. This parameter can contain the digits 0 through 9 and the plus (+), hyphen (-), and period (.) characters. The URL string must not include any message text or other information.
Reference : iPhoneURLScheme SMS
Upvotes: 9
Reputation: 59
Yes, it is possible.
A small gift, on ios 5 and 6
<a href="sms:123456789;body=sometext">sms link</a>
Upvotes: 3