Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you prepopulate an SMS using sms: like mailto:?

Tags:

mobile

sms

What I would like to do is pre populate an SMS similar to how you can populate the subject line of an email with ?subject on mailto: links.

I don't want to automatically send the SMS, or the recipients, just the copy (which the user could edit). From what I've read it looks like sms: only allows by specifying the recipients, or nothing at all.

Can this be done with sms:? Or does it require native code (for iOS/Android)?

like image 281
brendo Avatar asked Nov 01 '25 11:11

brendo


2 Answers

The answer to this question is now yes. This:

sms://+19875550198;?&body=This%20is%20a%20test%20message.

works just fine in Messages on both iOS and macOS. Copy and paste that link into your browser to test it on your system. I haven't tested this on other systems, but based on this answer, ;?& seems useful for cross-device compatibility.

An example of how we're using this can be seen in this answer. Unfortunately I couldn't figure out a way to populate the optional subject field in iOS.

like image 198
Vincent Avatar answered Nov 04 '25 10:11

Vincent


Short answer: No.

Although this would be helpful for web developers, neither Android nor iOS allows this to be done through urls.

Apple has a list of recognized url schemes here.

If you're developing an app with phonegap however, this can be done programmatically using plugins like SMSComposer for iOS and SMSPlugin for Android.

like image 44
Scorpius Avatar answered Nov 04 '25 10:11

Scorpius



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!