React Native Forward Calls
Android's Native call logs manipulator in React Native
Installation
npm install react-native-manipulate-call-log --save
npm page - https://www.npmjs.com/package/react-native-manipulate-call-log
Add permissions
- In
AndroidManifest.xml
add:
Project setup and initialization auto
react-native link
Project setup and initialization manually
- In
android/settings.gradle
...include ':react-native-manipulate-call-log', ':app'project(':react-native-manipulate-call-log').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-forward-calls/android')
- In
android/app/build.gradle
...dependencies { /* YOUR DEPENDENCIES HERE */ compile project(':react-native-manipulate-call-log') // <--- add this}
- Register Module (in MainApplication.java)
// <--- import
Usage
Import
Add call log at current time
Duration is given in seconds (second param)
CallLogs//adds an incoming call log, at:now from:123456789 duration:30secCallLogs//adds an outgoing call log, at:now to:123456789 duration:30secCallLogs//adds an missed call log, at:now from:123456789
Add call log at specific time
Duration is given in seconds (second param)
Time of call is given in Milliseconds (third param)
CallLogs//adds an incoming call log, at:05/02/2017-22:22:22 from:123456789 duration:30secCallLogs//adds an outgoing call log, at:now to:123456789 duration:30secCallLogs//adds an missed call log, at:05/02/2017-22:22:22 from:123456789