Package Exports
- react-native-forward-calls
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-forward-calls) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React Native Forward Calls
Android's Native call forwarding in React Native
Installation
npm install react-native-forward-calls --saveAdd permissions
- In
AndroidManifest.xmladd:
<uses-permission android:name="android.permission.CALL_PHONE" />Project setup and initialization auto
react-native linkProject setup and initialization manually
- In
android/settings.gradle
...
include ':react-native-forward-calls', ':app'
project(':react-native-forward-calls').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-forward-calls') // <--- add this
}
- Register Module (in MainApplication.java)
import com.himelbrand.forwardcalls.RNForwardCallsPackage; // <--- import
public class MainActivity extends ReactActivity {
......
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNForwardCallsPackage() // <--- Add this
);
}
......
}Usage
Import
import ForwardCalls from 'react-native-forward-calls'Forward calls
ForwardCalls.unconditionalForwarding('123456789')//Forward all calls unconditionally to the number 123456789
ForwardCalls.forwardCallsIfBusy('123456789')//Forward calls if busy to the number 123456789
ForwardCalls.forwardCallsIfNotAnswered('123456789')//Forward calls if not answered to the number 123456789
ForwardCalls.forwardCallsIfOutOfReach('123456789')//Forward calls if out of reach to the number 123456789
ForwardCalls.allConditionalForwarding('123456789')//All conditional forwarding activated to the number 123456789Cancel call forwarding
ForwardCalls.cancelUnconditional()
ForwardCalls.cancelIfBusy()
ForwardCalls.cancelIfNotAnswered()
ForwardCalls.cancelIfOutOfReach()
ForwardCalls.cancelAllConditional()