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.
Files changed (2) hide show
  1. package/README.md +32 -1
  2. 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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rns-nativecall",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
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",