0.2.1 • Published 7 years ago

react-native-call-events v0.2.1

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

react-native-call-events

A component to get call events fired back to your application.

Currently this works only on Android.

Installation

yarn add react-native-call-events

Usage

Initialize the listeners with

import RNCallEvent from 'react-native-call-events'
RNCallEvent.init(false, false);

Init Parameters:

ParameterDescription
returnOnCallReturn to the calling app when a phone call begins. Note: this currently does not work with a call that goes to voicemail.
returnOnEndReturn to the calling app when a phone call ends

Events

###callStatusUpdate Will be fired with every call status change

    DeviceEventEmitter.addListener('callStatusUpdate', event => {
      console.log(`Event: ${event}`);
    });

Event Object Properties

PropertyDescription
typeA string that will be one of: CALL_STATE_OFFHOOK, CALL_STATE_RINGING, or CALL_STATE_END
phonenumberWill be populated on both offhook and ringing, but most devices do not populate on end