Cordova PhoneCall Trap
Branch: master
Clone or download
Renan Oliveira
Renan Oliveira Fixing plugin name
Latest commit 66b43ee Jun 8, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/android Refactoring and cleaning plugin Apr 11, 2014
www Phone call states binded and working Apr 4, 2014
.fetch.json Initial commit Apr 3, 2014
.gitignore Updating readme Apr 16, 2014
LICENSE Updating readme Apr 16, 2014
README.md Updating readme Apr 16, 2014
package.json Fixing plugin name Jun 7, 2016
plugin.xml Add package.json (npm) Jun 7, 2016

README.md

Cordova PhoneCall Trap

It is a Apache Cordova plugin to simplify handling phone call status and events in Android devices.

Install

$ cordova plugin add io.gvox.plugin.phonecalltrap

Quick Example

PhoneCallTrap.onCall(function(state) {
    console.log("CHANGE STATE: " + state);

    switch (state) {
        case "RINGING":
            console.log("Phone is ringing");
            break;
        case "OFFHOOK":
            console.log("Phone is off-hook");
            break;

        case "IDLE":
            console.log("Phone is idle");
            break;
    }
});

Supported platforms

  • Android 2.3.3 or higher

References

We have tried PhoneListener but it is only compatible with Phonegap 1.6 and does not work with new Apache Cordova versions. Also, its deployment isn't as easy as an Apache Cordova plugin should be. We are thankful for their work, though.

https://github.com/devgeeks/PhoneListener

License

Cordova PhoneCall Trap is released under the MIT License.