Giter Site home page Giter Site logo

don-isdale / sendsmscordovaplugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dimitrismistriotis/sendsmscordovaplugin

0.0 2.0 0.0 139 KB

A plugin to send SMSes using apache Cordova, developed against version 2.3.0, modified for version 3.4.0

JavaScript 86.47% Java 13.53%

sendsmscordovaplugin's Introduction

SendSmsCordovaPlugin

A plugin to send SMSes using apache Cordova, developed against version 2.3.0

Setup

  1. Copy Java files from src folder to the src folder or your project.
  2. In config.xml (under "res/xml"), register the plugin (see also "res/xml/config.additional.xml"):
  3. Add the following lines in your AndroidManifest.additional.xml (see also AndroidManifest.additional.xml):
<!-- Additional permission for SendSms plugin -->
<uses-permission android:name="android.permission.SEND_SMS"/>
  1. Call can be made using the Cordova plugin invocation/interface:
cordova.exec(function(winParam) {}, function(error) {}, "SendSms", 
"SendSms", ["phoneNumber", "text message"]);

For the JavaScript call, first parameter the success callback, followed by the error callback, then the service, followed by the action. Finally we have the invocation parameters for the plugin as an array with the phone number first and the text second. There is a sample execution in "assets/www/index.sample.html".

Notes

In setup, (1) Is the actual plugin code, (3) gives the application the permission to send a text/SMS.

As we can see in the Java code, there is a "magic" phone number, "TESTNUM" (used in the sample execution, "index.sample.html"). Using this will always trigger the successful callback, without sending any text message anywhere.

Callback functions receive a json object with three properties: sms_send (true when calling successful dispatch, false if something has gone wrong), receiving_number (the number the text/SMS was distributed to) and send_text (the text send).

In case you are interested in reading texts/Sms messages, refer to this plugin's sibling: ReadSmsPlugin, using the same semantics, under the same license. License

Please refer to LICENSE file in this repository.

Note

Initially by Dimitrios of WeBootU please consider us for your Cordova related projects.

sendsmscordovaplugin's People

Contributors

dimitrismistriotis avatar don-isdale avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.