8

I've been trying to play with Phonegap and created a small application in HTML/Javascript to send an SMS. I tried this code window.location.href = 'sms:XXXXXXXX06?body=Testing' which opens up a screen to manually send the sms which I want to automate.

Please note that I create an android app by uploading my project source code to build.phonegap.com, so I can not modify the .apk source.

Is it possible to do it in Javascript only?

codef0rmer
  • 10,284
  • 9
  • 53
  • 76

3 Answers3

3

See the Phonegap SMS Plugin to send SMS messages.

dda
  • 6,030
  • 2
  • 25
  • 34
  • Hey @dda, thanks for sharing it but I was already aware of such plugin. I've changed my approach to the problem and posted a new question here (http://stackoverflow.com/q/11921401/415057), would like to hear your views? – codef0rmer Aug 12 '12 at 16:56
  • hi i use the same code but i am getting this Uncaught TypeError: Cannot read property 'sms' of undefined . I included the js file and putt the java file and permission too the error is at this window.plugins.sms.send($('#number').val(), $('#message').val(), function () { alert('Message sent successfully'); }, function (e) { alert('Message Failed:' + e); } ); – Uahmed Jul 14 '13 at 22:28
3

here is the phonegap-sms-plugin

Prabakaran G
  • 83
  • 1
  • 13
0

try to make somthing like this:

<a href="smsto:000000000"> sms number</a>

it works for me on Android device.

ghost rider3
  • 448
  • 1
  • 5
  • 17