Autocomplete SMS message in Phonegap / Cordova iOS and Android
Just add to KateMihalikova's answer (I don't have enough comments to add a comment), but her answer is correct except for iOS> = 7; IOS 7 body is not supported (I believe if you already had a history with the SMS number in question this will work, but I haven't tested it); however iOS 8 brought back body preprocessing: you must replace ; which was used for iOS <= 6 with & instead of:
iOS 8: sms:+123456789&body=hello there
source to share
sms:
schema
Android: sms:+123456789?body=hello there
iOS! = 7: sms:+123456789;body=hello there
iOS = 7: sms:+123456789
- body not supported
You can use link or javascript location
:
<a href="sms:+123456789?body=hello there">Send SMS</a>
window.location = "sms:+123456789?body=" + encodeURIComponent("hello there");
The sms app opens by default and populates with the provided data.
Cordova plugin
Some examples:
Not tested
9.3.2015 modified with iOS 8
source to share