react-native-phone-caller

1.0.2 • Public • Published

react-native-phone-caller

React Native phone calls for iOS and Android

Getting started

$ npm install --save react-native-phone-caller or $ yarn add react-native-phone-caller

Mostly automatic installation

$ react-native link react-native-phone-caller

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-phone-caller and add RNPhoneCaller.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNPhoneCaller.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.PhoneCaller.RNPhoneCallerPackage; to the imports at the top of the file ``
  • Add new RNPhoneCallerPackage() to the list returned by the getPackages() method
import com.PhoneCaller.RNPhoneCallerPackage; // <--- 1

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    protected boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {

    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new RNPhoneCallerPackage() // <--- 2
    );
  }
};

....
  1. Append the following lines to android/settings.gradle:
include ':react-native-phone-caller'
project(':react-native-phone-caller').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-phone-caller/android')
  1. Insert the following lines inside the dependencies block in android/app/build.gradle:
implementation project(':react-native-phone-caller')

Usage

PhoneCaller.call(tel)

Arguments:

  • tel: String - a phone number to call

Returns: Promise

  • fulfilled: String - Success
  • rejected: Error
import PhoneCaller from 'react-native-phone-caller';

PhoneCaller.call('+98887776655');

Package Sidebar

Install

npm i react-native-phone-caller

Weekly Downloads

1

Version

1.0.2

License

none

Unpacked Size

15.5 kB

Total Files

21

Last publish

Collaborators

  • sshulzhenko