@telnyx/react-voice-commons-sdk 0.1.7-beta.1 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # CHANGELOG.md
2
2
 
3
+ ## [0.1.7](https://github.com/team-telnyx/react-native-voice-commons/releases/tag/0.1.7) (2026-02-20)
4
+
5
+ ### Enhancement
6
+
7
+ • Added `TelnyxVoipClient.isLaunchedFromPushNotification()` static method to check if the app was cold-started from a push notification, allowing consumers to skip auto-login and avoid double-login races
8
+ • `createTelnyxVoipClient()` now returns a singleton — safe to call inside React component bodies without creating a new instance on every render
9
+ • Added `destroyTelnyxVoipClient()` to tear down the singleton when a fresh instance is needed
10
+ • `TelnyxVoiceApp` now automatically wires the `voipClient` on the CallKit coordinator on mount — consumers no longer need to manually call `setVoipClient()` at the correct component level
11
+
12
+ ### Bug Fixing
13
+
14
+ • Fixed cold-start push notification failures caused by double-login race between user auto-login and SDK internal push login
15
+ • Fixed CallKit coordinator having no `voipClient` reference when user answered a call via CallKit before navigating to the correct screen
16
+ • Fixed `call_id` extraction in `checkForInitialPushNotification` — the double-nested path `pushData.metadata?.metadata?.call_id` never resolved, so the CallKit coordinator was bypassed on iOS
17
+ • Refactored `checkForInitialPushNotification` into `getAndroidPushData` and `getIOSPushData` helpers to reduce nesting and improve readability
18
+
19
+ ### Deprecation
20
+
21
+ • `setVoipClient()` on `CallKitCoordinator` and `useCallKitCoordinator()` hook is now deprecated — `TelnyxVoiceApp` handles this automatically
22
+
23
+ ## [0.1.7-beta.0](https://github.com/team-telnyx/react-native-voice-commons/releases/tag/0.1.7-beta.0) (2026-02-18)
24
+
25
+ ### Bug Fixing
26
+
27
+ • Fixed `call_id` extraction in `checkForInitialPushNotification` — the double-nested path `pushData.metadata?.metadata?.call_id` never resolved, so the CallKit coordinator was bypassed and all iOS push calls fell through to direct handling
28
+ • Refactored `checkForInitialPushNotification` into `getAndroidPushData` and `getIOSPushData` helpers to reduce nesting and improve readability
29
+
3
30
  ## [0.1.6](https://github.com/team-telnyx/react-native-voice-commons/releases/tag/0.1.6) (2025-12-09)
4
31
 
5
32
  ### Enhancement
@@ -326,8 +326,8 @@ class CallStateController {
326
326
  console.log('CallStateController: Reporting incoming call to CallKitCoordinator');
327
327
  callkit_coordinator_1.callKitCoordinator.reportIncomingCall(
328
328
  telnyxCall,
329
- call.destination,
330
- call.destination
329
+ call.callerName,
330
+ call.callerNumber
331
331
  );
332
332
  } else {
333
333
  // Handle outgoing call with CallKit
@@ -49,7 +49,9 @@ export declare class SessionManager {
49
49
  */
50
50
  disconnect(): Promise<void>;
51
51
  /**
52
- * Disable push notifications for the current session
52
+ * Disable push notifications for the current session.
53
+ * Delegates to the TelnyxRTC client's disablePushNotification() method
54
+ * which sends a 'telnyx_rtc.disable_push_notification' message via the socket.
53
55
  */
54
56
  disablePushNotifications(): void;
55
57
  /**
@@ -140,16 +140,19 @@ class SessionManager {
140
140
  this._connectionState.next(connection_state_1.TelnyxConnectionState.DISCONNECTED);
141
141
  }
142
142
  /**
143
- * Disable push notifications for the current session
143
+ * Disable push notifications for the current session.
144
+ * Delegates to the TelnyxRTC client's disablePushNotification() method
145
+ * which sends a 'telnyx_rtc.disable_push_notification' message via the socket.
144
146
  */
145
147
  disablePushNotifications() {
146
148
  if (
147
149
  this._telnyxClient &&
148
150
  this.currentState === connection_state_1.TelnyxConnectionState.CONNECTED
149
151
  ) {
150
- // Implementation depends on the actual Telnyx SDK API
151
- // This is a placeholder for the actual implementation
152
- console.log('Disabling push notifications for session:', this._sessionId);
152
+ console.log('SessionManager: Disabling push notifications for session:', this._sessionId);
153
+ this._telnyxClient.disablePushNotification();
154
+ } else {
155
+ console.warn('SessionManager: Cannot disable push - client not connected');
153
156
  }
154
157
  }
155
158
  /**
@@ -46,6 +46,16 @@ export declare class Call {
46
46
  * Whether this is an outgoing call
47
47
  */
48
48
  get isOutgoing(): boolean;
49
+ /**
50
+ * The original caller name (from_display_name) received in the INVITE message.
51
+ * Falls back to destination if not available.
52
+ */
53
+ get callerName(): string;
54
+ /**
55
+ * The original caller number received in the INVITE message.
56
+ * Falls back to destination if not available.
57
+ */
58
+ get callerNumber(): string;
49
59
  /**
50
60
  * Current call state (synchronous access)
51
61
  */
@@ -115,6 +115,20 @@ class Call {
115
115
  get isOutgoing() {
116
116
  return !this._isIncoming;
117
117
  }
118
+ /**
119
+ * The original caller name (from_display_name) received in the INVITE message.
120
+ * Falls back to destination if not available.
121
+ */
122
+ get callerName() {
123
+ return this._originalCallerName || this._destination;
124
+ }
125
+ /**
126
+ * The original caller number received in the INVITE message.
127
+ * Falls back to destination if not available.
128
+ */
129
+ get callerNumber() {
130
+ return this._originalCallerNumber || this._destination;
131
+ }
118
132
  /**
119
133
  * Current call state (synchronous access)
120
134
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telnyx/react-voice-commons-sdk",
3
- "version": "0.1.7-beta.1",
3
+ "version": "0.1.7",
4
4
  "description": "A high-level, state-agnostic, drop-in module for the Telnyx React Native SDK that simplifies WebRTC voice calling integration",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",
@@ -392,7 +392,7 @@ export class CallStateController {
392
392
  } else if (call.isIncoming) {
393
393
  // Handle incoming call with CallKit (only if not already integrated)
394
394
  console.log('CallStateController: Reporting incoming call to CallKitCoordinator');
395
- callKitCoordinator.reportIncomingCall(telnyxCall, call.destination, call.destination);
395
+ callKitCoordinator.reportIncomingCall(telnyxCall, call.callerName, call.callerNumber);
396
396
  } else {
397
397
  // Handle outgoing call with CallKit
398
398
  console.log('CallStateController: Starting outgoing call with CallKitCoordinator');
@@ -111,13 +111,16 @@ export class SessionManager {
111
111
  }
112
112
 
113
113
  /**
114
- * Disable push notifications for the current session
114
+ * Disable push notifications for the current session.
115
+ * Delegates to the TelnyxRTC client's disablePushNotification() method
116
+ * which sends a 'telnyx_rtc.disable_push_notification' message via the socket.
115
117
  */
116
118
  disablePushNotifications(): void {
117
119
  if (this._telnyxClient && this.currentState === TelnyxConnectionState.CONNECTED) {
118
- // Implementation depends on the actual Telnyx SDK API
119
- // This is a placeholder for the actual implementation
120
- console.log('Disabling push notifications for session:', this._sessionId);
120
+ console.log('SessionManager: Disabling push notifications for session:', this._sessionId);
121
+ this._telnyxClient.disablePushNotification();
122
+ } else {
123
+ console.warn('SessionManager: Cannot disable push - client not connected');
121
124
  }
122
125
  }
123
126
 
@@ -66,6 +66,22 @@ export class Call {
66
66
  return !this._isIncoming;
67
67
  }
68
68
 
69
+ /**
70
+ * The original caller name (from_display_name) received in the INVITE message.
71
+ * Falls back to destination if not available.
72
+ */
73
+ get callerName(): string {
74
+ return this._originalCallerName || this._destination;
75
+ }
76
+
77
+ /**
78
+ * The original caller number received in the INVITE message.
79
+ * Falls back to destination if not available.
80
+ */
81
+ get callerNumber(): string {
82
+ return this._originalCallerNumber || this._destination;
83
+ }
84
+
69
85
  /**
70
86
  * Current call state (synchronous access)
71
87
  */
@@ -83,6 +83,7 @@ declare module '@telnyx/react-native-voice-sdk' {
83
83
  connect(): Promise<void>;
84
84
  disconnect(): void;
85
85
  newCall(options: CallOptions): Promise<Call>;
86
+ disablePushNotification(): void;
86
87
 
87
88
  on(event: string, listener: (...args: any[]) => void): this;
88
89
  off(event: string, listener: (...args: any[]) => void): this;