@rentlydev/react-native-incomingcall
v0.6.0
Published
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, th
Downloads
1,475
Readme
@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-incomingcallor
yarn add @rentlydev/react-native-incomingcallConfiguration 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 falseregisterReceiver
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
- 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 iosand dopod install, thencd .. - For android run
yarn android - For ios run
yarn ios
