是否可以使用电话短信 API 从 phonegap HTML/Javascript 应用程序发送短信?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11916704/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to send SMS from phonegap HTML/Javascript application using Phone SMS API?
提问by codef0rmer
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.
我一直在尝试使用 Phonegap 并在 HTML/Javascript 中创建了一个小应用程序来发送短信。我试过这段代码window.location.href = 'sms:XXXXXXXX06?body=Testing'
,它打开一个屏幕来手动发送我想要自动化的短信。
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.
请注意,我通过将我的项目源代码上传到build.phonegap.com来创建一个 android 应用程序,因此我无法修改.apk
源代码。
Is it possible to do it in Javascript only?
是否可以仅在 Javascript 中执行此操作?
采纳答案by dda
See the Phonegap SMS Pluginto send SMS messages.
请参阅Phonegap SMS 插件以发送 SMS 消息。
回答by Prabakaran G
here is the phonegap-sms-plugin
回答by ghost rider3
try to make somthing like this:
尝试做这样的事情:
<a href="smsto:000000000"> sms number</a>
it works for me on Android device.
它适用于我在 Android 设备上。