varunkumar / phonegap-missedcall-plugin

This Android Phonegap plugin will notify your app whenever there is a missed call.
Other
2 stars 1 forks source link

phonegap-missedcall-plugin

This Android Phonegap plugin will notify your app whenever there is a missed call. This plugin was successfully tested with Phonegap 2.9 and Android 4.2.2 (on a Samsung Galaxy Nexus device).

Adding the plugin to project

Using the plugin

To instantiate the plugin object:

var missedCallPlugin = cordova.require('cordova/plugin/missedcallplugin');

startReception

Start the missed call receiver waiting for missed calls The success callback function will be called everytime a call is missed. The callback will receive a JSON object containing the contactName and contactNumber. You can add more fields from MissedCallReceiver.java. The error callback is called if an error occurs.

Example:

  missedCallPlugin.startReception (function(msg) {
    alert(msg);
  }, function() {
    alert("Error while receiving call details");
  });

stopReception

Stop the missed call receiver

Example:

  missedCallPlugin.stopReception (function() {
    alert("Correctly stopped");
  }, function() {
    alert("Error while stopping the call receiver");
  });

License

The source code is available here under MIT licence. Please send any bugs, feedback, complaints, patches to me at varunkumar[dot]n[at]gmail[dot]com.

-- Varun

Last Modified: Tue Jul 16 08:56:36 IST 2013