0.1.4 • Published 7 years ago

cordova-plugin-phonecallstate v0.1.4

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

NPM

cordova-plugin-phonecallstate

Phone Call State Plugin for Cordova Android, compatible for ionic 2.

Installation

cordova plugin add cordova-plugin-phonecallstate

Usage

declare var PhoneCallState: any;

PhoneCallState.watchState((response) => {
  let state: string = response.state;
  let incoming_number: string = response.number;

  switch (state) {
    case 'IDLE':
      break;
    case 'OFFHOOK':
      break;
    case 'RINGING':
      break;
  }
}, (err) => {
  // Permission Denied
});