rns-nativecall 1.2.4 → 1.2.6
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 -13
- package/index.d.ts +1 -1
- package/index.js +6 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -127,23 +127,33 @@ export default function App() {
|
|
|
127
127
|
}
|
|
128
128
|
```
|
|
129
129
|
---
|
|
130
|
-
|
|
131
|
-
# rns-nativecall API Reference
|
|
130
|
+
## 📖 rns-nativecall API Reference
|
|
132
131
|
|
|
132
|
+
|
|
133
|
+
### Core Methods
|
|
133
134
|
| Method | Platform | Description |
|
|
134
135
|
| :--- | :--- | :--- |
|
|
135
136
|
| **registerHeadlessTask(callback)** | All | Registers the background task. `eventType` is 'INCOMING_CALL', 'BUSY', or 'ABORTED_CALL'. |
|
|
136
|
-
| **displayCall(uuid, name, type)** | All |
|
|
137
|
-
| **
|
|
138
|
-
| **
|
|
139
|
-
| **showMissedCall(uuid, name, type)** |
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
| **
|
|
145
|
-
| **
|
|
146
|
-
| **
|
|
137
|
+
| **displayCall(uuid, name, type)** | All | Launches full-screen Activity (Android) or reports to CallKit (iOS). |
|
|
138
|
+
| **destroyNativeCallUI(uuid)** | All | Stops ringtone/Activity (Android) or ends CallKit session (iOS). |
|
|
139
|
+
| **subscribe(onAccept, onReject, onFailed)** | All | Listens for Answer/Decline actions and system-level bridge errors. |
|
|
140
|
+
| **showMissedCall(uuid, name, type)** | Android | Posts a persistent notification in the device tray for missed calls. |
|
|
141
|
+
|
|
142
|
+
### Data & State Management
|
|
143
|
+
| Method | Platform | Description |
|
|
144
|
+
| :--- | :--- | :--- |
|
|
145
|
+
| **getInitialCallData()** | All | Retrieves the call payload if the app was cold-started via a notification. |
|
|
146
|
+
| **checkCallValidity(uuid)** | All | Returns `{isValid, isCanceled}` to prevent ghost or aborted calls. |
|
|
147
|
+
| **checkCallStatus(uuid)** | All | Returns `{isCanceled, isActive, shouldDisplay}` for UI syncing. |
|
|
148
|
+
|
|
149
|
+
### Android Permissions
|
|
150
|
+
| Method | Platform | Description |
|
|
151
|
+
| :--- | :--- | :--- |
|
|
152
|
+
| **checkOverlayPermission()** | Android | Returns `true` if app can draw over other apps (Heads-up UI). |
|
|
153
|
+
| **checkFullScreenPermission()** | Android | (Android 14+) Checks if app can trigger full-screen intents. |
|
|
154
|
+
| **requestOverlayPermission()** | Android | Navigates user to "Draw over other apps" system settings. |
|
|
155
|
+
| **requestFullScreenSettings()** | Android | (Android 14+) Navigates user to "Full Screen Intent" settings. |
|
|
156
|
+
|
|
147
157
|
---
|
|
148
158
|
|
|
149
159
|
# 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;
|