Page 1 of 1

Sending SMS (text message)

Posted: Wed May 02, 2012 8:17 pm
by AppTest

Hello!

Is there a way to send a text message to a predefined phone number?

I'm trying to create a button that sends a text message (SMS) with the user location.

For example User clicks the button Admin get a text message that says:
"Hello, I'm here: Main Street 15, San Diego, USA"


Sending SMS (text message)

Posted: Wed May 02, 2012 8:51 pm
by maxkatz

You can send an SMS message via some API. Here is an example using ATT API:
http://help.tiggzi.com/getting-starte...

Or, call the native SMS app:

code
window.location.href='sms:xxxxxxxxxx';
/code


Sending SMS (text message)

Posted: Thu Feb 14, 2013 5:40 am
by Barbara

I had this working before like this

window.location.href = "sms:" + $('#number').val() + "?body=" + messagetext;

But now i get this error when I test

The address wasn't understood

Firefox doesn't know how to open this address, because the protocol (sms) isn't associated with any program.

You might need to install other software to open this address.


Sending SMS (text message)

Posted: Thu Feb 14, 2013 5:49 am
by maxkatz

It won't work in desktop browser, only on the phone.


Sending SMS (text message)

Posted: Thu Feb 14, 2013 5:49 am
by Barbara

Here's the error from firebug

NS_ERROR_UNKNOWN_PROTOCOL: Component returned failure code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL) [nsIDOMLocation.href]
[Break On This Error]

xhr.send( ( s.hasContent && s.data ) || null );


Sending SMS (text message)

Posted: Thu Feb 14, 2013 5:52 am
by maxkatz

Won't work in desktop browser. SMS can only be sent from a phone.