npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hazems-cordova-plugin-sms

v0.0.2

Published

A plugin for sending sms messages

Downloads

6

Readme

Notice

This plugin is one of the examples of the "JavaScript Mobile Application Development" book which can be reached at: http://www.amazon.com/JavaScript-Native-Mobile-Apps-Development/dp/1783554177/ https://www.packtpub.com/web-development/javascript-native-mobile-apps-development

Sms Custom Cordova Plugin:

This plugin allows you to send SMS message to a specific phone number for Android, iOS and Windows Platform 8. Here is an example below:

var messageInfo = {
	phoneNumber: "xxxxxxxxxx",
	textMessage: "This is a test message"
};

sms.sendMessage(messageInfo, function(message) {
	console.log("success: " + message);
}, function(error) {
	console.log("code: " + error.code + ", message: " + error.message);
});

As you notice you just need to call sms.sendMessage(messageInfo, successCallback, failureCallback):

  • messageInfo is a JSON object which contains phoneNumber and textMessage attributes.
  • sucessCallback is a callback function which will be called if the send SMS operation succeeds.
  • errorCallback is a callback function which will be called if the send SMS operation fails.

Installing the plugin

In order to install the plugin you can simply use the following Cordova CLI command:

cordova plugin add https://github.com/hazems/cordova-sms-plugin.git

or

cordova plugin add com.jsmobile.plugins.sms

Important Note

For iOS and Windows Phone platforms, it is not possible to send SMS directly without opening the default device SMS application. This means that the API will only open and track the SMS application events (cancel, successful sending, un-successful sending, ...etc) in iOS platform. For Windows Phone 8, the plugin will only open the SMS application without tracking its events because tracking SMS application events is not currently applicable in Windows 8 platform.

Test Client

You can reach the test client of this plugin here: https://github.com/hazems/cordova-sms-plugin-test/

Used Resources

Special Thanks to appcoda.com for helping me in implementing the iOS part of this plugin:

http://www.appcoda.com/ios-programming-send-sms-text-message/

Licence

It is Apache License, Version 2.0. Feel free to fork the project and send pull requests if you have any.