Skip to content

Latest commit

 

History

History
111 lines (77 loc) · 2.71 KB

README.md

File metadata and controls

111 lines (77 loc) · 2.71 KB

npm React Native Android

@rentlydev/react-native-incomingcall

A react native module to display an incoming call UI triggered by push notifications. Instead of relying on TelephonyManager, this approach uses push notifications sent from a server to notify the app of an incoming call. Upon receiving the notification, the app launches a custom incoming call screen, mimicking the native call UI.

Fully compatible with TypeScript.

Supported platforms

Platform Support
iOS
Android
Web
Windows
macOS

Installation

npm install @rentlydev/react-native-incomingcall

or

yarn add @rentlydev/react-native-incomingcall

Configuration and Permissions

No permissions needed

Summary

Methods


Usage

showIncomingCall

import IncomingCall from '@rentlydev/react-native-incomingcall';

IncomingCall.showIncomingCall();

endCall

import IncomingCall from '@rentlydev/react-native-incomingcall';

IncomingCall.endCall();

areNotificationsEnabled

import IncomingCall from '@rentlydev/react-native-incomingcall';

const response = IncomingCall.areNotificationsEnabled();

Reponse: true or false

registerReceiver

import IncomingCall from '@rentlydev/react-native-incomingcall';

IncomingCall.registerReceiver();

unregisterReceiver

import IncomingCall from '@rentlydev/react-native-incomingcall';

IncomingCall.unregisterReceiver();

Events

  React.useEffect(() => {
    const listener = DeviceEventEmitter.addListener("intercom_broadcast", (data) => {
      console.log("intercom_broadcast", data);
    });

    return () => listener.remove();
  });

How To Run Example App ?

To run example app, follow the below steps

  1. Clone the repository
  2. Do yarn install
  3. Next navigate to example folder i.e cd example
  4. Do yarn install
  5. Next navigate to ios folder i.e cd ios and do pod install, then cd ..
  6. For android run yarn android
  7. For ios run yarn ios

Demo Video

Android