rns-nativecall 0.9.6 → 0.9.7
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 +32 -1
- 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';
|