0.8.0 • Published 1 year ago

my-cs v0.8.0

Weekly downloads
4
License
MIT
Repository
github
Last release
1 year ago

my-cs

React Native Notification Incoming Call For Android This library works based on android display time-sensitive notifications For more information about Display time-sensitive notifications (https://developer.android.com/training/notify-user/time-sensitive).

⚠️ This library only work for Android .

Installation

npm install my-cs

Addition installation step

In AndroidManifest.xml:

// ...
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
    <application ....>
      <activity android:name="com.incomingcall.IncomingCallActivity"
        android:launchMode="singleTask"
        android:excludeFromRecents="true"
        android:exported="true"
        android:showWhenLocked="true"
        android:turnScreenOn="true"
      />

      <activity android:name="com.incomingcall.NotificationReceiverActivity"
        android:launchMode="singleTask"
        android:excludeFromRecents="true"
        android:exported="true"
        android:showWhenLocked="true"
        android:turnScreenOn="true"
      />

      <service
        android:name="com.incomingcall.IncomingCallService"
        android:enabled="true"
        android:stopWithTask="false"
        android:exported="true" />

     .....
      </application>

Usage

import RNIncomingCall, { type foregroundOptionsModel } from 'my-cs';

const options: foregroundOptionsModel = {
  channelId: 'com.incomingcallexample',
  channelName: 'Incoming video call',
  notificationIcon: 'ic_launcher', //mipmap
  notificationBody: 'Hello',
  notificationTitle: 'Someone calling',
  answerText: 'Answer',
  declineText: 'Decline',
  notificationColor: 'colorAccent', //path color in android
  notificationSound: null, //raw
  mainComponent: 'IncomingCall',
};

RNIncomingCall.displayNotification(callUUID, null, 30000, options);

// ...

// index.js
AppRegistry.registerComponent('IncomingCall', () => YOUR_CUSTOM_COMPONENT);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.3.0

1 year ago

0.8.0

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.7.0

1 year ago

0.5.2

1 year ago

0.6.0

1 year ago

0.5.1

1 year ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago