Skip to content Skip to sidebar Skip to footer

Window.open("sms:...") Works For Android But Not For Ios

I have this function, which pre-fills sms text message on click. This works on Android, but on any version if iOS, it just open new empty window. Any idea, why?     var ua = nav

Solution 1:

I tried with a proper HTML link, and it works well on iOS 9.

<a href="sms:+467111111111?&body=Hello my friend">Send SMS</a>

So I can see two potential issues :

  • I might not work with window.open();
  • It only works when a number is provided

Edit: I managed to make it work without a number

<a href="sms:?&body=Hello my friend">Send SMS</a>

So it seems to come from window.open()

Solution 2:

The link below should help you test all the different combinations. Just open it from your cellphone.

What has been working for me is: href="sms://&body=TEST"

list of sms combination format here

Post a Comment for "Window.open("sms:...") Works For Android But Not For Ios"