rns-nativecall 1.2.4 → 1.2.5
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 +23 -11
- package/index.d.ts +1 -1
- package/index.js +6 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,20 +130,32 @@ export default function App() {
|
|
|
130
130
|
### 📖 API Reference
|
|
131
131
|
# rns-nativecall API Reference
|
|
132
132
|
|
|
133
|
+
## API Reference
|
|
134
|
+
|
|
135
|
+
### Core Methods
|
|
133
136
|
| Method | Platform | Description |
|
|
134
137
|
| :--- | :--- | :--- |
|
|
135
138
|
| **registerHeadlessTask(callback)** | All | Registers the background task. `eventType` is 'INCOMING_CALL', 'BUSY', or 'ABORTED_CALL'. |
|
|
136
|
-
| **displayCall(uuid, name, type)** | All |
|
|
137
|
-
| **
|
|
138
|
-
| **
|
|
139
|
-
| **
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
| **
|
|
145
|
-
| **
|
|
146
|
-
| **
|
|
139
|
+
| **displayCall(uuid, name, type)** | All | Launches full-screen Activity (Android) or reports to CallKit (iOS). |
|
|
140
|
+
| **destroyNativeCallUI(uuid)** | All | Stops ringtone/Activity (Android) or ends CallKit session (iOS). |
|
|
141
|
+
| **showMissedCall(uuid, name, type)** | Android | Posts a persistent notification in the device tray for missed calls. |
|
|
142
|
+
| **subscribe(onAccept, onReject, onFailed)** | All | Listens for Answer/Decline actions and system-level bridge errors. |
|
|
143
|
+
|
|
144
|
+
### Data & State Management
|
|
145
|
+
| Method | Platform | Description |
|
|
146
|
+
| :--- | :--- | :--- |
|
|
147
|
+
| **getInitialCallData()** | All | Retrieves the call payload if the app was cold-started via a notification. |
|
|
148
|
+
| **checkCallValidity(uuid)** | All | Returns `{isValid, isCanceled}` to prevent ghost or aborted calls. |
|
|
149
|
+
| **checkCallStatus(uuid)** | All | Returns `{isCanceled, isActive, shouldDisplay}` for UI syncing. |
|
|
150
|
+
|
|
151
|
+
### Android Permissions
|
|
152
|
+
| Method | Platform | Description |
|
|
153
|
+
| :--- | :--- | :--- |
|
|
154
|
+
| **checkOverlayPermission()** | Android | Returns `true` if app can draw over other apps (Heads-up UI). |
|
|
155
|
+
| **checkFullScreenPermission()** | Android | (Android 14+) Checks if app can trigger full-screen intents. |
|
|
156
|
+
| **requestOverlayPermission()** | Android | Navigates user to "Draw over other apps" system settings. |
|
|
157
|
+
| **requestFullScreenSettings()** | Android | (Android 14+) Navigates user to "Full Screen Intent" settings. |
|
|
158
|
+
|
|
147
159
|
---
|
|
148
160
|
|
|
149
161
|
# Implementation Notes
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -78,11 +78,6 @@ export const CallHandler = {
|
|
|
78
78
|
return await CallModule.checkCallStatus(uuid.toLowerCase().trim());
|
|
79
79
|
},
|
|
80
80
|
|
|
81
|
-
showMissedCall: async (uuid, name, callType) => {
|
|
82
|
-
if (!CallModule?.showMissedCall) return false;
|
|
83
|
-
return await CallModule.showMissedCall(uuid.toLowerCase().trim(), name, callType);
|
|
84
|
-
},
|
|
85
|
-
|
|
86
81
|
//--------------------------------------------------------------------------------------
|
|
87
82
|
|
|
88
83
|
requestOverlayPermission: async () => {
|
|
@@ -97,6 +92,12 @@ export const CallHandler = {
|
|
|
97
92
|
return await CallModule.requestFullScreenSettings();
|
|
98
93
|
},
|
|
99
94
|
|
|
95
|
+
showMissedCall: async (uuid, name, callType) => {
|
|
96
|
+
if (Platform.OS === 'ios') return true;
|
|
97
|
+
if (!CallModule?.showMissedCall) return false;
|
|
98
|
+
return await CallModule.showMissedCall(uuid.toLowerCase().trim(), name, callType);
|
|
99
|
+
},
|
|
100
|
+
|
|
100
101
|
checkOverlayPermission: async () => {
|
|
101
102
|
if (Platform.OS === 'ios') return true;
|
|
102
103
|
if (!CallModule?.checkOverlayPermission) return false;
|