Skip to content

seed880505/cordova-plugin-phonecallstate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
});