1

I am trying to create a link in an email that will open a mobile device's default texting app if pushed. Here is what I have so far:

a href="sms:;?&body=This%20is%20the%20body%20message."

I have tested it and it seems to work on iOS devices as well as some Android devices. However, on a Google Pixel 3, it opens the default messaging app but shows an error which reads Could not start conversation.

How can I change my code to successfully open a conversation with a blank recipient?

vs97
  • 5,765
  • 3
  • 28
  • 41
Sean
  • 11
  • 2
  • Even with a number, I can't seem to get any pre-filled text on my Google Pixel 3, so I'm curious if anyone finds a solution. – AuRise Apr 12 '19 at 16:00

2 Answers2

3

After hours of trial and error, I was able to prefill the Pixel (3XL), iOS (simulated in Xcode), and macOS Messages using the following structure:

Pixel: sms://+1${PHONE}/?body=${encodedString}
iOS: sms://+1${PHONE}/&body=${encodedString}

0

Give this a try from a link, I think you need a number and replace ; with ?

<a href="sms:444-222-3333?body=Hello World!">Send SMS</a>

For non iOS you want to use (For your Pixel Example) sms:phone_number?body=The_Message

For iOS you want to use sms:phone_number;body=The_Message

Matt
  • 21
  • 6
  • Hey Matt, For some reason that made the link non-clickable. I double-checked that I implemented your code accurately and it still wasn't working. – Sean Feb 22 '19 at 21:54