rns-nativecall 0.9.6 → 0.9.8
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 +37 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,8 +49,39 @@ CallHandler.registerHeadlessTask(async (data, eventType) => {
|
|
|
49
49
|
|
|
50
50
|
AppRegistry.registerComponent('main', () => App);
|
|
51
51
|
```
|
|
52
|
-
### 2. Handling Events (App.js)
|
|
52
|
+
### 2. Handling Events (Index.js/App.js)
|
|
53
53
|
Use the subscribe method to handle user interaction (Accept/Reject) from the native UI.
|
|
54
|
+
```javascript
|
|
55
|
+
// Index.js Setup Foreground Listeners
|
|
56
|
+
CallHandler.subscribe(
|
|
57
|
+
|
|
58
|
+
async (data) => {
|
|
59
|
+
try {
|
|
60
|
+
console.log("APP IS OPEN", data)
|
|
61
|
+
// navigate here
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.log("pending_call_uuid", error)
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
async (data) => {
|
|
68
|
+
try {
|
|
69
|
+
console.log("CALL DECLINE", data)
|
|
70
|
+
// update the caller here call decline
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.log("Onreject/ cancel call error", error)
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
(data) => { console.log("failded", data) }
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
````
|
|
81
|
+
|
|
82
|
+
## App.js version
|
|
83
|
+
|
|
84
|
+
|
|
54
85
|
```javascript
|
|
55
86
|
import React, { useEffect } from 'react';
|
|
56
87
|
import { CallHandler } from 'rns-nativecall';
|
|
@@ -83,11 +114,12 @@ export default function App() {
|
|
|
83
114
|
### 📖 API Reference
|
|
84
115
|
| Method | Description |
|
|
85
116
|
| :--- | :--- |
|
|
86
|
-
| **registerHeadlessTask(callback)** | Registers background logic. `eventType` is `
|
|
87
|
-
| **displayCall(uuid, name, type)** | Shows the native call UI. Type is `
|
|
117
|
+
| **registerHeadlessTask(callback)** | Registers background logic. `eventType` is `INCOMING_CALL` or `BUSY`. |
|
|
118
|
+
| **displayCall(uuid, name, type)** | Shows the native call UI. Type is `audio` or `video`. |
|
|
119
|
+
| **checkCallValidity(uuid)** | Returns boolen value for `isValid` and `isCanceled` |
|
|
88
120
|
| **destroyNativeCallUI(uuid)** | Dismisses the native call interface. |
|
|
89
|
-
| **getInitialCallData()** | Returns call data if the app was launched by clicking
|
|
90
|
-
| **subscribe(onAccept, onReject)** | Listens for native button presses (Answer/End)
|
|
121
|
+
| **getInitialCallData()** | Returns call data if the app was launched by clicking `Answer`. |
|
|
122
|
+
| **subscribe(onAccept, onReject)** | Listens for native button presses `(Answer/End)`. |
|
|
91
123
|
---
|
|
92
124
|
|
|
93
125
|
## 🛡 License
|