Send sms from a mobile device via HTML5 / javascript

8

I am creating a mobile WEB application that will be downloaded in one of the store's, with an integrated mini WEB server that works on any operating system (iOS, android, windows8, etc).

In order for the application to be as independent as possible from the operating system, I just wanted to use HTML5 and JavaScript .

The application allows a user to make a series of requests by simply clicking on buttons. Example: [View Contacts]

I need to automatically send sms to another mobile device with a android application that receives the request, and send and receive the response via sms. The answer also has to be read by my WEB application. This is for the application to work without mobile network / Wifi.

I've been browsing and can only find ways to open the sms application on my mobile device.

Is there a way to do this automatically?

And if it does not exist can it be done in another way? Type use / create a plugin to use in JavaScript that does this to me?

[EDIT] I saw this yesterday and I was already researching on the subject, but it looks like the job was discontinued , unfortunately. I do not even know if it would be a chance.

    
asked by anonymous 09.04.2014 / 19:28

2 answers

13

You can not currently send SMS with HTML without writing native code , the closest you can do is open the message submission application with the fields filled in, to do so use

<a href="sms:99999999?body=Oi">Clique para enviar oi</a>

The syntax is:

sms[to]://[<destination number>][?parameters].

The phone number parameter is optional.

If you really want to send this without opening the Android sender the modes are:

  • With javascript you call some function on a web server (asp.net, php, etc) that sends the SMS to you.
  • Create a native Android code that intercepts the HTML action and sends.
  • Sources:

    link

    link

    a>

    link

        
    15.04.2014 / 14:11
    1

    Can not do this using javascript only. However, using Cordova it is possible to develop mobile applications using HTML, CSS and Javascript. It has several plug-ins, including one for sending and receiving SMS. Cordova Website: link . SMS Plug-in: link

        
    13.10.2016 / 19:39