Skip to content

Instantly share code, notes, and snippets.

@rahulinaction
Created September 2, 2014 05:57
Show Gist options
  • Save rahulinaction/2703b8c6f30f5daa1732 to your computer and use it in GitHub Desktop.
Save rahulinaction/2703b8c6f30f5daa1732 to your computer and use it in GitHub Desktop.
A sample javascript plugin file for calling phone number
var PhoneDialer = function() {
}
PhoneDialer.prototype.dial = function(phnum) {
//alert("the phonedialer"+phnum)
cordova.exec("PhoneDialer.dialPhone", {"number" : phnum });
};
if(!window.plugins) {
window.plugins = {};
}
if(!window.plugins.phoneDialer) {
window.plugins.phoneDialer = new PhoneDialer();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment