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.
Platform | Support |
---|---|
iOS | ❌ |
Android | ✅ |
Web | ❌ |
Windows | ❌ |
macOS | ❌ |
npm install @rentlydev/react-native-incomingcall
or
yarn add @rentlydev/react-native-incomingcall
No permissions needed
import IncomingCall from '@rentlydev/react-native-incomingcall';
IncomingCall.showIncomingCall();
import IncomingCall from '@rentlydev/react-native-incomingcall';
IncomingCall.endCall();
import IncomingCall from '@rentlydev/react-native-incomingcall';
const response = IncomingCall.areNotificationsEnabled();
Reponse: true or false
import IncomingCall from '@rentlydev/react-native-incomingcall';
IncomingCall.registerReceiver();
import IncomingCall from '@rentlydev/react-native-incomingcall';
IncomingCall.unregisterReceiver();
React.useEffect(() => {
const listener = DeviceEventEmitter.addListener("intercom_broadcast", (data) => {
console.log("intercom_broadcast", data);
});
return () => listener.remove();
});
To run example app, follow the below steps
- Clone the repository
- Do
yarn install
- Next navigate to example folder i.e
cd example
- Do
yarn install
- Next navigate to ios folder i.e
cd ios
and dopod install
, thencd ..
- For android run
yarn android
- For ios run
yarn ios