Search code examples
iphonemobilewebkitsmsmobile-safari

Can I launch the iPhone or Android SMS app from the browser with pre-filled body text?


I want to be able to launch the iPhone and/or Android SMS app with "body" or "message" field already having the correct text.

I came across this question however the top answer was only partially working for me and it didn't ask everything I was looking for.

From what I can tell, either of the following will launch the sms app on my iPhone and gives the correct number to send it to.

<a href="sms:1-234-567-8901">Send SMS</a>
<a href="sms:12345678901">Send SMS</a>

As soon as I ad something like ?body=hello or ?message=hello it fails to bring over the phone number and body text.

These fail:

<a href="sms:1-234-567-8901?body=hello">Send SMS</a>
<a href="sms:12345678901?message=hello">Send SMS</a>

Any help or insight would be greatly appreciated!


Solution

  • I'm afraid the answer won't be what you're hoping for - currently neither Android nor iOS will let you launch an SMS from the browser with a pre-populated message body. You can only trigger a blank SMS from the browser to a specific number. This holds for all versions of iOS, and whilst I haven't tried it out on Android 4.0, I don't see anything pointing to a change. Sorry that it isn't better news!

    Here's Apple's complete list of URL schemes that they support: Apple's URL Scheme Reference,