rns-nativecall 1.2.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -138,6 +138,7 @@ export default function App() {
138
138
  | **destroyNativeCallUI(uuid)** | All | Stops ringtone/Activity (Android) or ends CallKit session (iOS). |
139
139
  | **subscribe(onAccept, onReject, onFailed)** | All | Listens for Answer/Decline actions and system-level bridge errors. |
140
140
  | **showMissedCall(uuid, name, type)** | Android | Posts a persistent notification in the device tray for missed calls. |
141
+ | **showOnGoingCall(uuid, name, type)** | Android | Show a persistent notification in the device tray for on going calls. |
141
142
 
142
143
  ### Data & State Management
143
144
  | Method | Platform | Description |
@@ -183,6 +183,27 @@ class CallModule(
183
183
  }
184
184
  }
185
185
 
186
+ @ReactMethod
187
+ fun showOnGoingCall(
188
+ uuid: String,
189
+ name: String,
190
+ callType: String,
191
+ promise: Promise,
192
+ ) {
193
+ try {
194
+ val data =
195
+ mapOf(
196
+ "callUuid" to uuid,
197
+ "name" to name,
198
+ "callType" to callType,
199
+ )
200
+ NativeCallManager.showOnGoingCall(reactApplicationContext, data)
201
+ promise.resolve(true)
202
+ } catch (e: Exception) {
203
+ promise.reject("ONGOING_CALL_ERROR", e.message)
204
+ }
205
+ }
206
+
186
207
  @ReactMethod
187
208
  fun endNativeCall(uuid: String) {
188
209
  NativeCallManager.dismissIncomingCall(reactApplicationContext, uuid)
package/index.d.ts CHANGED
@@ -71,6 +71,15 @@ export interface CallHandlerType {
71
71
  callType?: 'audio' | 'video',
72
72
  ): Promise<boolean>;
73
73
 
74
+ /**
75
+ * Show showOnGoingCall on the device notification tray.
76
+ */
77
+ showOnGoingCall(
78
+ uuid: string,
79
+ name: string,
80
+ callType?: 'audio' | 'video',
81
+ ): Promise<boolean>;
82
+
74
83
  /** * Checks if a call is still valid and has not been canceled.
75
84
  */
76
85
  checkCallValidity(uuid: string): Promise<ValidityStatus>;
package/index.js CHANGED
@@ -98,6 +98,12 @@ export const CallHandler = {
98
98
  return await CallModule.showMissedCall(uuid.toLowerCase().trim(), name, callType);
99
99
  },
100
100
 
101
+ showOnGoingCall: async (uuid, name, callType) => {
102
+ if (Platform.OS === 'ios') return true;
103
+ if (!CallModule?.showOnGoingCall) return false;
104
+ return await CallModule.showOnGoingCall(uuid.toLowerCase().trim(), name, callType);
105
+ },
106
+
101
107
  checkOverlayPermission: async () => {
102
108
  if (Platform.OS === 'ios') return true;
103
109
  if (!CallModule?.checkOverlayPermission) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rns-nativecall",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "description": "High-performance React Native module for handling native VoIP call UI on Android and iOS.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",