3

我已经使用 2.3.0 版本开发了 phonegap 应用程序。这个应用程序有太多的电话插件,如下载器、pdfviewer、状态栏通知、视频。现在我想在同一个应用程序中实现 sms 插件。我试图实现 sms 插件使用此应用程序,但无法正常工作。我觉得它与多个版本的cordova混淆了。所以请清除我的问题,如何包含和编写使用phonegap发送短信的发送短信代码以及如何将短信插件包含到我的应用程序中。非常清楚地与我分享答案。提前致谢

4

1 回答 1

2

此短信插件适用于 phonegap 2.3.0

SendSmsCordovaPlugin

样本:

                    

<script type="text/javascript">
                    sendSmsDemo = function() {
                        cordova.exec(function(winParam) {
                                // Use the following line if json2 library is present.
                                // Available from Douglas Crockford's github page here:
                                // https://github.com/douglascrockford/JSON-js/blob/master/json2.js
                                console.log( JSON.stringify(winParam) );
                                alert(winParam.sms_send);
                            }
                            , function(error) {
                                alert("An error has occurred");
                                console.log("An error has occurred");
                                // Please refer to previous comment about json2 library.
                                console.log( JSON.stringify(error) );
                            }
                            , "SendSms"
                             ,"SendSms"
                             , ["TESTNUM", "This is random text."]);
                    }
                    </script>
于 2013-07-12T07:40:48.413 回答