expo-callkit-telecom 0.2.7 → 0.3.0

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.
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.3.0"
3
+ }
package/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ All notable changes to `expo-callkit-telecom` are documented here.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.0](https://github.com/mfairley/expo-callkit-telecom/compare/v0.2.8...v0.3.0) (2026-05-17)
9
+
10
+
11
+ ### Features
12
+
13
+ * **docs:** branded icon, demo gallery, social cards, SEO outlinks ([33f8bc3](https://github.com/mfairley/expo-callkit-telecom/commit/33f8bc3d6329fe04ca6f76eca452b481941fef64))
14
+
15
+
16
+ ### Documentation
17
+
18
+ * **readme:** swap <video> for clickable poster <img> ([584dd1f](https://github.com/mfairley/expo-callkit-telecom/commit/584dd1f717766536e87c3b4cef3196412e606045))
19
+
20
+ ## [0.2.8](https://github.com/mfairley/expo-callkit-telecom/compare/v0.2.7...v0.2.8) (2026-05-16)
21
+
22
+
23
+ ### Documentation
24
+
25
+ * cross-link related functions and add per-page SEO descriptions ([c03b2d4](https://github.com/mfairley/expo-callkit-telecom/commit/c03b2d4420bd15f2fd40c1ad1f20112bedc9a122))
26
+
8
27
  ## [0.2.7] — 2026-05-16
9
28
 
10
29
  ### Added
package/README.md CHANGED
@@ -14,6 +14,39 @@ The module is opinionated about *system integration* and unopinionated about *me
14
14
  <img alt="license" src="https://img.shields.io/npm/l/expo-callkit-telecom">
15
15
  </p>
16
16
 
17
+ <h2 align="center">📱 See it in action</h2>
18
+
19
+ <table align="center">
20
+ <tr>
21
+ <th></th>
22
+ <th align="center">Outgoing call</th>
23
+ <th align="center">Incoming (banner)</th>
24
+ <th align="center">Incoming (full screen)</th>
25
+ </tr>
26
+ <tr>
27
+ <td align="center"><strong>iOS</strong></td>
28
+ <td align="center">
29
+ <a href="https://github.com/mfairley/expo-callkit-telecom/raw/main/docs/public/outgoing-call-ios.mp4" title="Click to watch — outgoing call on iOS">
30
+ <img src="docs/public/outgoing-call-ios-poster.jpg" alt="Outgoing call on iOS (click to watch)" width="200">
31
+ </a>
32
+ </td>
33
+ <td align="center"><img src="docs/public/incoming-call-banner-ios.png" alt="Incoming call banner on iOS" width="200"></td>
34
+ <td align="center"><img src="docs/public/incoming-call-fullscreen-ios.png" alt="Incoming call full screen on iOS" width="200"></td>
35
+ </tr>
36
+ <tr>
37
+ <td align="center"><strong>Android</strong></td>
38
+ <td align="center">
39
+ <a href="https://github.com/mfairley/expo-callkit-telecom/raw/main/docs/public/outgoing-call-android.mp4" title="Click to watch — outgoing call on Android">
40
+ <img src="docs/public/outgoing-call-android-poster.jpg" alt="Outgoing call on Android (click to watch)" width="200">
41
+ </a>
42
+ </td>
43
+ <td align="center"><img src="docs/public/incoming-call-banner-android.png" alt="Incoming call banner on Android" width="200"></td>
44
+ <td align="center"><img src="docs/public/incoming-call-fullscreen-android.png" alt="Incoming call full screen on Android" width="200"></td>
45
+ </tr>
46
+ </table>
47
+
48
+ <p align="center"><sub>▶︎ Click an outgoing-call thumbnail above to watch the video. Or see the full demo on the <a href="https://mfairley.github.io/expo-callkit-telecom/">docs site</a>.</sub></p>
49
+
17
50
  ## ✨ Features
18
51
 
19
52
  - 📱 **Native calling UI** — CallKit on iOS, Telecom incoming-call notification + full-screen intent on Android
package/build/Calls.d.ts CHANGED
@@ -154,6 +154,9 @@ export declare function setRTCAudioSessionConfiguration(hasVideo: boolean): void
154
154
  * @param hasVideo - Whether to configure for video calls (uses speaker by default)
155
155
  * or audio-only calls (uses earpiece by default).
156
156
  *
157
+ * @see {@link restoreAudioSession} — call this after the call ends to revert the session configuration.
158
+ * @see {@link getAudioSession} — inspect the resulting audio session state.
159
+ *
157
160
  * @category Audio
158
161
  */
159
162
  export declare function prepareAudioSessionForCall(hasVideo: boolean): void;
@@ -164,6 +167,8 @@ export declare function prepareAudioSessionForCall(hasVideo: boolean): void;
164
167
  * or to manually restore the audio session. This is called automatically when
165
168
  * the audio session is deactivated after a call ends.
166
169
  *
170
+ * @see {@link prepareAudioSessionForCall} — the matching setup call.
171
+ *
167
172
  * @category Audio
168
173
  */
169
174
  export declare function restoreAudioSession(): void;
@@ -248,6 +253,10 @@ export declare function addCallIntentReceivedListener(listener: (event: CallInte
248
253
  * );
249
254
  * ```
250
255
  *
256
+ * @see {@link addOutgoingCallStartedListener} for the event fired once the OS accepts the call.
257
+ * @see {@link reportOutgoingCallConnected} to call after the remote media stream is established.
258
+ * @see {@link endCall} to terminate the call from the app.
259
+ *
251
260
  * @category Requests
252
261
  */
253
262
  export declare function startOutgoingCall(recipient: CallParticipant, options: CallOptions): Promise<string>;
@@ -261,6 +270,9 @@ export declare function startOutgoingCall(recipient: CallParticipant, options: C
261
270
  * @param listener - Callback invoked when an outgoing call starts.
262
271
  * @returns A subscription that can be removed by calling `.remove()`.
263
272
  *
273
+ * @see {@link startOutgoingCall} — the request that triggers this event.
274
+ * @see {@link reportOutgoingCallConnected} — the next step in the outgoing-call flow.
275
+ *
264
276
  * @category Call Events
265
277
  */
266
278
  export declare function addOutgoingCallStartedListener(listener: (event: OutgoingCallStartedEvent) => void): EventSubscription;
@@ -286,6 +298,10 @@ export declare function addOutgoingCallStartedListener(listener: (event: Outgoin
286
298
  * });
287
299
  * ```
288
300
  *
301
+ * @see {@link addIncomingCallReportedListener} — fires once the OS accepts the report.
302
+ * @see {@link addCallAnsweredListener} — fires when the user answers from the system UI.
303
+ * @see [VoIP push payload shape](https://mfairley.github.io/expo-callkit-telecom/voip-push) — the payload that drives this when called from a native push handler.
304
+ *
289
305
  * @category Reporters
290
306
  */
291
307
  export declare function reportIncomingCall(event: IncomingCallEvent): Promise<void>;
@@ -299,6 +315,9 @@ export declare function reportIncomingCall(event: IncomingCallEvent): Promise<vo
299
315
  * @param listener - Callback invoked when an incoming call is reported.
300
316
  * @returns A subscription that can be removed by calling `.remove()`.
301
317
  *
318
+ * @see {@link reportIncomingCall} — the report that triggers this event.
319
+ * @see {@link addCallAnsweredListener} — fires when the user answers from the system UI.
320
+ *
302
321
  * @category Call Events
303
322
  */
304
323
  export declare function addIncomingCallReportedListener(listener: (event: IncomingCallReportedEvent) => void): EventSubscription;
@@ -310,6 +329,10 @@ export declare function addIncomingCallReportedListener(listener: (event: Incomi
310
329
  *
311
330
  * @param id - The call session ID to answer.
312
331
  *
332
+ * @see {@link addCallAnsweredListener} — react to user-initiated answers from the system UI; most apps listen here rather than calling this directly.
333
+ * @see {@link fulfillIncomingCallConnected} — call after media is established.
334
+ * @see {@link failIncomingCallConnected} — call if media setup fails.
335
+ *
313
336
  * @category Requests
314
337
  */
315
338
  export declare function answerCall(id: string): Promise<void>;
@@ -322,6 +345,10 @@ export declare function answerCall(id: string): Promise<void>;
322
345
  * @param listener - Callback invoked when a call is answered.
323
346
  * @returns A subscription that can be removed by calling `.remove()`.
324
347
  *
348
+ * @see {@link answerCall} — the programmatic equivalent (rarely needed; usually the OS UI triggers answering).
349
+ * @see {@link fulfillIncomingCallConnected} — call after media setup completes.
350
+ * @see {@link failIncomingCallConnected} — call if media setup fails.
351
+ *
325
352
  * @category Call Events
326
353
  */
327
354
  export declare function addCallAnsweredListener(listener: (event: CallAnsweredEvent) => void): EventSubscription;
@@ -333,6 +360,9 @@ export declare function addCallAnsweredListener(listener: (event: CallAnsweredEv
333
360
  *
334
361
  * @param requestId - The request ID from the CallAnsweredEvent.
335
362
  *
363
+ * @see {@link addCallAnsweredListener} — the event you typically respond to before calling this.
364
+ * @see {@link failIncomingCallConnected} — call this instead if media setup fails.
365
+ *
336
366
  * @category Fulfillers
337
367
  */
338
368
  export declare function fulfillIncomingCallConnected(requestId: string): Promise<void>;
@@ -348,6 +378,9 @@ export declare function fulfillIncomingCallConnected(requestId: string): Promise
348
378
  * @param id - The call session ID.
349
379
  * @param requestId - The request ID from the CallAnsweredEvent.
350
380
  *
381
+ * @see {@link fulfillIncomingCallConnected} — call this on the success path.
382
+ * @see {@link addCallAnsweredListener} — the event you typically respond to before calling either fulfiller.
383
+ *
351
384
  * @category Fulfillers
352
385
  */
353
386
  export declare function failIncomingCallConnected(id: string, requestId: string): Promise<void>;
@@ -359,6 +392,9 @@ export declare function failIncomingCallConnected(id: string, requestId: string)
359
392
  *
360
393
  * @param id - The call session ID.
361
394
  *
395
+ * @see {@link startOutgoingCall} — the call that initiated this outgoing flow.
396
+ * @see {@link addOutgoingCallStartedListener} — fires when the OS accepts the request.
397
+ *
362
398
  * @category Reporters
363
399
  */
364
400
  export declare function reportOutgoingCallConnected(id: string): Promise<void>;
@@ -371,6 +407,9 @@ export declare function reportOutgoingCallConnected(id: string): Promise<void>;
371
407
  *
372
408
  * @param id - The call session ID to end.
373
409
  *
410
+ * @see {@link addCallEndedListener} — confirms the call ended.
411
+ * @see {@link reportCallEnded} — call this instead when the remote party hung up (a server-side signal), so the OS records the right reason.
412
+ *
374
413
  * @category Requests
375
414
  */
376
415
  export declare function endCall(id: string): Promise<void>;
@@ -383,6 +422,9 @@ export declare function endCall(id: string): Promise<void>;
383
422
  * @param listener - Callback invoked when a call ends.
384
423
  * @returns A subscription that can be removed by calling `.remove()`.
385
424
  *
425
+ * @see {@link endCall} — the app-side request that fires this when the user ends from your UI.
426
+ * @see {@link reportCallEnded} — for remote-initiated ends (server tells you the other party hung up).
427
+ *
386
428
  * @category Call Events
387
429
  */
388
430
  export declare function addCallEndedListener(listener: (event: CallEndedEvent) => void): EventSubscription;
@@ -404,6 +446,9 @@ export declare function addCallEndedListener(listener: (event: CallEndedEvent) =
404
446
  * await reportCallEnded(callId, 'failed');
405
447
  * ```
406
448
  *
449
+ * @see {@link endCall} — the app-initiated path (your user ended the call).
450
+ * @see {@link addReportedCallEndedListener} — confirms the OS accepted the report.
451
+ *
407
452
  * @category Reporters
408
453
  */
409
454
  export declare function reportCallEnded(id: string, reason: CallEndedReason): Promise<void>;
@@ -416,6 +461,8 @@ export declare function reportCallEnded(id: string, reason: CallEndedReason): Pr
416
461
  * @param listener - Callback invoked when a call end is reported.
417
462
  * @returns A subscription that can be removed by calling `.remove()`.
418
463
  *
464
+ * @see {@link reportCallEnded} — the report that triggers this event.
465
+ *
419
466
  * @category Call Events
420
467
  */
421
468
  export declare function addReportedCallEndedListener(listener: (event: CallReportedEnded) => void): EventSubscription;
@@ -428,6 +475,8 @@ export declare function addReportedCallEndedListener(listener: (event: CallRepor
428
475
  * @param id - The call session ID.
429
476
  * @param muted - Whether the microphone should be muted.
430
477
  *
478
+ * @see {@link addSetMutedActionListener} — fires when the system requests a mute change (e.g. the user pressed mute in the CallKit UI); apply the change to your media stream from there.
479
+ *
431
480
  * @category Requests
432
481
  */
433
482
  export declare function setMuted(id: string, muted: boolean): Promise<void>;
@@ -440,6 +489,8 @@ export declare function setMuted(id: string, muted: boolean): Promise<void>;
440
489
  * @param listener - Callback invoked when set muted action is requested.
441
490
  * @returns A subscription that can be removed by calling `.remove()`.
442
491
  *
492
+ * @see {@link setMuted} — for the app-initiated direction (programmatic mute toggle).
493
+ *
443
494
  * @category Call Events
444
495
  */
445
496
  export declare function addSetMutedActionListener(listener: (event: SetMutedActionEvent) => void): EventSubscription;
@@ -451,6 +502,8 @@ export declare function addSetMutedActionListener(listener: (event: SetMutedActi
451
502
  * @param id - The call session ID.
452
503
  * @param enabled - Whether video is enabled.
453
504
  *
505
+ * @see {@link addVideoChangedListener} — the inverse direction (system-side video state changes).
506
+ *
454
507
  * @category Reporters
455
508
  */
456
509
  export declare function reportVideo(id: string, enabled: boolean): Promise<void>;
@@ -462,6 +515,8 @@ export declare function reportVideo(id: string, enabled: boolean): Promise<void>
462
515
  * @param listener - Callback invoked when video state changes.
463
516
  * @returns A subscription that can be removed by calling `.remove()`.
464
517
  *
518
+ * @see {@link reportVideo} — for reporting your app's video state changes back to the system.
519
+ *
465
520
  * @category Call Events
466
521
  */
467
522
  export declare function addVideoChangedListener(listener: (event: VideoChangedEvent) => void): EventSubscription;
@@ -474,6 +529,8 @@ export declare function addVideoChangedListener(listener: (event: VideoChangedEv
474
529
  * @param id - The call session ID.
475
530
  * @param onHold - Whether the call should be on hold.
476
531
  *
532
+ * @see {@link addSetHeldActionListener} — fires when the system requests a hold-state change.
533
+ *
477
534
  * @category Requests
478
535
  */
479
536
  export declare function setHeld(id: string, onHold: boolean): Promise<void>;
@@ -486,6 +543,8 @@ export declare function setHeld(id: string, onHold: boolean): Promise<void>;
486
543
  * @param listener - Callback invoked when set held action is requested.
487
544
  * @returns A subscription that can be removed by calling `.remove()`.
488
545
  *
546
+ * @see {@link setHeld} — for the app-initiated direction.
547
+ *
489
548
  * @category Call Events
490
549
  */
491
550
  export declare function addSetHeldActionListener(listener: (event: SetHeldActionEvent) => void): EventSubscription;
@@ -498,6 +557,8 @@ export declare function addSetHeldActionListener(listener: (event: SetHeldAction
498
557
  * @param id - The call session ID.
499
558
  * @param digits - The DTMF digits to play (0-9, *, #).
500
559
  *
560
+ * @see {@link addDTMFListener} — fires when the system requests DTMF tones (e.g. from the in-call keypad).
561
+ *
501
562
  * @category Requests
502
563
  */
503
564
  export declare function playDTMF(id: string, digits: string): Promise<void>;
@@ -510,6 +571,8 @@ export declare function playDTMF(id: string, digits: string): Promise<void>;
510
571
  * @param listener - Callback invoked when DTMF tones should be played.
511
572
  * @returns A subscription that can be removed by calling `.remove()`.
512
573
  *
574
+ * @see {@link playDTMF} — for the app-initiated direction (programmatically play tones).
575
+ *
513
576
  * @category Call Events
514
577
  */
515
578
  export declare function addDTMFListener(listener: (event: DTMFEvent) => void): EventSubscription;
@@ -535,6 +598,10 @@ export declare function addDTMFListener(listener: (event: DTMFEvent) => void): E
535
598
  * });
536
599
  * ```
537
600
  *
601
+ * @see {@link getVoIPPushToken} — read the current token synchronously after registration.
602
+ * @see {@link useVoIPPushToken} — React hook that reads the token and subscribes to updates.
603
+ * @see {@link addVoIPPushTokenUpdatedListener} — non-React subscription to token updates.
604
+ *
538
605
  * @category VoIP Push
539
606
  */
540
607
  export declare function registerVoIPPush(): void;
@@ -554,6 +621,9 @@ export declare function registerVoIPPush(): void;
554
621
  * }
555
622
  * ```
556
623
  *
624
+ * @see {@link registerVoIPPush} — must be called once before a token is available.
625
+ * @see {@link useVoIPPushToken} — React hook wrapper around this + the update listener.
626
+ *
557
627
  * @category VoIP Push
558
628
  */
559
629
  export declare function getVoIPPushToken(): VoIPPushToken | null;
@@ -579,6 +649,9 @@ export declare function getVoIPPushToken(): VoIPPushToken | null;
579
649
  * });
580
650
  * ```
581
651
  *
652
+ * @see {@link useVoIPPushToken} — React hook that uses this internally; prefer it in components.
653
+ * @see {@link registerVoIPPush} — must be called once before any token updates fire.
654
+ *
582
655
  * @category VoIP Push
583
656
  */
584
657
  export declare function addVoIPPushTokenUpdatedListener(listener: (event: VoIPPushTokenUpdatedEvent) => void): EventSubscription;
@@ -1 +1 @@
1
- {"version":3,"file":"Calls.d.ts","sourceRoot":"","sources":["../src/Calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG3D,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EAC1B,MAAM,eAAe,CAAC;AAQvB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,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AACH,wBAAsB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAExE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,GACnC,iBAAiB,CAEnB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAOvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,GACnD,iBAAiB,CAEnB"}
package/build/Calls.js CHANGED
@@ -183,6 +183,9 @@ export function setRTCAudioSessionConfiguration(hasVideo) {
183
183
  * @param hasVideo - Whether to configure for video calls (uses speaker by default)
184
184
  * or audio-only calls (uses earpiece by default).
185
185
  *
186
+ * @see {@link restoreAudioSession} — call this after the call ends to revert the session configuration.
187
+ * @see {@link getAudioSession} — inspect the resulting audio session state.
188
+ *
186
189
  * @category Audio
187
190
  */
188
191
  export function prepareAudioSessionForCall(hasVideo) {
@@ -195,6 +198,8 @@ export function prepareAudioSessionForCall(hasVideo) {
195
198
  * or to manually restore the audio session. This is called automatically when
196
199
  * the audio session is deactivated after a call ends.
197
200
  *
201
+ * @see {@link prepareAudioSessionForCall} — the matching setup call.
202
+ *
198
203
  * @category Audio
199
204
  */
200
205
  export function restoreAudioSession() {
@@ -297,6 +302,10 @@ export function addCallIntentReceivedListener(listener) {
297
302
  * );
298
303
  * ```
299
304
  *
305
+ * @see {@link addOutgoingCallStartedListener} for the event fired once the OS accepts the call.
306
+ * @see {@link reportOutgoingCallConnected} to call after the remote media stream is established.
307
+ * @see {@link endCall} to terminate the call from the app.
308
+ *
300
309
  * @category Requests
301
310
  */
302
311
  export async function startOutgoingCall(recipient, options) {
@@ -312,6 +321,9 @@ export async function startOutgoingCall(recipient, options) {
312
321
  * @param listener - Callback invoked when an outgoing call starts.
313
322
  * @returns A subscription that can be removed by calling `.remove()`.
314
323
  *
324
+ * @see {@link startOutgoingCall} — the request that triggers this event.
325
+ * @see {@link reportOutgoingCallConnected} — the next step in the outgoing-call flow.
326
+ *
315
327
  * @category Call Events
316
328
  */
317
329
  export function addOutgoingCallStartedListener(listener) {
@@ -342,6 +354,10 @@ export function addOutgoingCallStartedListener(listener) {
342
354
  * });
343
355
  * ```
344
356
  *
357
+ * @see {@link addIncomingCallReportedListener} — fires once the OS accepts the report.
358
+ * @see {@link addCallAnsweredListener} — fires when the user answers from the system UI.
359
+ * @see [VoIP push payload shape](https://mfairley.github.io/expo-callkit-telecom/voip-push) — the payload that drives this when called from a native push handler.
360
+ *
345
361
  * @category Reporters
346
362
  */
347
363
  export async function reportIncomingCall(event) {
@@ -357,6 +373,9 @@ export async function reportIncomingCall(event) {
357
373
  * @param listener - Callback invoked when an incoming call is reported.
358
374
  * @returns A subscription that can be removed by calling `.remove()`.
359
375
  *
376
+ * @see {@link reportIncomingCall} — the report that triggers this event.
377
+ * @see {@link addCallAnsweredListener} — fires when the user answers from the system UI.
378
+ *
360
379
  * @category Call Events
361
380
  */
362
381
  export function addIncomingCallReportedListener(listener) {
@@ -373,6 +392,10 @@ export function addIncomingCallReportedListener(listener) {
373
392
  *
374
393
  * @param id - The call session ID to answer.
375
394
  *
395
+ * @see {@link addCallAnsweredListener} — react to user-initiated answers from the system UI; most apps listen here rather than calling this directly.
396
+ * @see {@link fulfillIncomingCallConnected} — call after media is established.
397
+ * @see {@link failIncomingCallConnected} — call if media setup fails.
398
+ *
376
399
  * @category Requests
377
400
  */
378
401
  export async function answerCall(id) {
@@ -387,6 +410,10 @@ export async function answerCall(id) {
387
410
  * @param listener - Callback invoked when a call is answered.
388
411
  * @returns A subscription that can be removed by calling `.remove()`.
389
412
  *
413
+ * @see {@link answerCall} — the programmatic equivalent (rarely needed; usually the OS UI triggers answering).
414
+ * @see {@link fulfillIncomingCallConnected} — call after media setup completes.
415
+ * @see {@link failIncomingCallConnected} — call if media setup fails.
416
+ *
390
417
  * @category Call Events
391
418
  */
392
419
  export function addCallAnsweredListener(listener) {
@@ -403,6 +430,9 @@ export function addCallAnsweredListener(listener) {
403
430
  *
404
431
  * @param requestId - The request ID from the CallAnsweredEvent.
405
432
  *
433
+ * @see {@link addCallAnsweredListener} — the event you typically respond to before calling this.
434
+ * @see {@link failIncomingCallConnected} — call this instead if media setup fails.
435
+ *
406
436
  * @category Fulfillers
407
437
  */
408
438
  export async function fulfillIncomingCallConnected(requestId) {
@@ -420,6 +450,9 @@ export async function fulfillIncomingCallConnected(requestId) {
420
450
  * @param id - The call session ID.
421
451
  * @param requestId - The request ID from the CallAnsweredEvent.
422
452
  *
453
+ * @see {@link fulfillIncomingCallConnected} — call this on the success path.
454
+ * @see {@link addCallAnsweredListener} — the event you typically respond to before calling either fulfiller.
455
+ *
423
456
  * @category Fulfillers
424
457
  */
425
458
  export async function failIncomingCallConnected(id, requestId) {
@@ -441,6 +474,9 @@ export async function failIncomingCallConnected(id, requestId) {
441
474
  *
442
475
  * @param id - The call session ID.
443
476
  *
477
+ * @see {@link startOutgoingCall} — the call that initiated this outgoing flow.
478
+ * @see {@link addOutgoingCallStartedListener} — fires when the OS accepts the request.
479
+ *
444
480
  * @category Reporters
445
481
  */
446
482
  export async function reportOutgoingCallConnected(id) {
@@ -458,6 +494,9 @@ export async function reportOutgoingCallConnected(id) {
458
494
  *
459
495
  * @param id - The call session ID to end.
460
496
  *
497
+ * @see {@link addCallEndedListener} — confirms the call ended.
498
+ * @see {@link reportCallEnded} — call this instead when the remote party hung up (a server-side signal), so the OS records the right reason.
499
+ *
461
500
  * @category Requests
462
501
  */
463
502
  export async function endCall(id) {
@@ -472,6 +511,9 @@ export async function endCall(id) {
472
511
  * @param listener - Callback invoked when a call ends.
473
512
  * @returns A subscription that can be removed by calling `.remove()`.
474
513
  *
514
+ * @see {@link endCall} — the app-side request that fires this when the user ends from your UI.
515
+ * @see {@link reportCallEnded} — for remote-initiated ends (server tells you the other party hung up).
516
+ *
475
517
  * @category Call Events
476
518
  */
477
519
  export function addCallEndedListener(listener) {
@@ -495,6 +537,9 @@ export function addCallEndedListener(listener) {
495
537
  * await reportCallEnded(callId, 'failed');
496
538
  * ```
497
539
  *
540
+ * @see {@link endCall} — the app-initiated path (your user ended the call).
541
+ * @see {@link addReportedCallEndedListener} — confirms the OS accepted the report.
542
+ *
498
543
  * @category Reporters
499
544
  */
500
545
  export async function reportCallEnded(id, reason) {
@@ -509,6 +554,8 @@ export async function reportCallEnded(id, reason) {
509
554
  * @param listener - Callback invoked when a call end is reported.
510
555
  * @returns A subscription that can be removed by calling `.remove()`.
511
556
  *
557
+ * @see {@link reportCallEnded} — the report that triggers this event.
558
+ *
512
559
  * @category Call Events
513
560
  */
514
561
  export function addReportedCallEndedListener(listener) {
@@ -526,6 +573,8 @@ export function addReportedCallEndedListener(listener) {
526
573
  * @param id - The call session ID.
527
574
  * @param muted - Whether the microphone should be muted.
528
575
  *
576
+ * @see {@link addSetMutedActionListener} — fires when the system requests a mute change (e.g. the user pressed mute in the CallKit UI); apply the change to your media stream from there.
577
+ *
529
578
  * @category Requests
530
579
  */
531
580
  export async function setMuted(id, muted) {
@@ -540,6 +589,8 @@ export async function setMuted(id, muted) {
540
589
  * @param listener - Callback invoked when set muted action is requested.
541
590
  * @returns A subscription that can be removed by calling `.remove()`.
542
591
  *
592
+ * @see {@link setMuted} — for the app-initiated direction (programmatic mute toggle).
593
+ *
543
594
  * @category Call Events
544
595
  */
545
596
  export function addSetMutedActionListener(listener) {
@@ -556,6 +607,8 @@ export function addSetMutedActionListener(listener) {
556
607
  * @param id - The call session ID.
557
608
  * @param enabled - Whether video is enabled.
558
609
  *
610
+ * @see {@link addVideoChangedListener} — the inverse direction (system-side video state changes).
611
+ *
559
612
  * @category Reporters
560
613
  */
561
614
  export async function reportVideo(id, enabled) {
@@ -569,6 +622,8 @@ export async function reportVideo(id, enabled) {
569
622
  * @param listener - Callback invoked when video state changes.
570
623
  * @returns A subscription that can be removed by calling `.remove()`.
571
624
  *
625
+ * @see {@link reportVideo} — for reporting your app's video state changes back to the system.
626
+ *
572
627
  * @category Call Events
573
628
  */
574
629
  export function addVideoChangedListener(listener) {
@@ -586,6 +641,8 @@ export function addVideoChangedListener(listener) {
586
641
  * @param id - The call session ID.
587
642
  * @param onHold - Whether the call should be on hold.
588
643
  *
644
+ * @see {@link addSetHeldActionListener} — fires when the system requests a hold-state change.
645
+ *
589
646
  * @category Requests
590
647
  */
591
648
  export async function setHeld(id, onHold) {
@@ -600,6 +657,8 @@ export async function setHeld(id, onHold) {
600
657
  * @param listener - Callback invoked when set held action is requested.
601
658
  * @returns A subscription that can be removed by calling `.remove()`.
602
659
  *
660
+ * @see {@link setHeld} — for the app-initiated direction.
661
+ *
603
662
  * @category Call Events
604
663
  */
605
664
  export function addSetHeldActionListener(listener) {
@@ -617,6 +676,8 @@ export function addSetHeldActionListener(listener) {
617
676
  * @param id - The call session ID.
618
677
  * @param digits - The DTMF digits to play (0-9, *, #).
619
678
  *
679
+ * @see {@link addDTMFListener} — fires when the system requests DTMF tones (e.g. from the in-call keypad).
680
+ *
620
681
  * @category Requests
621
682
  */
622
683
  export async function playDTMF(id, digits) {
@@ -631,6 +692,8 @@ export async function playDTMF(id, digits) {
631
692
  * @param listener - Callback invoked when DTMF tones should be played.
632
693
  * @returns A subscription that can be removed by calling `.remove()`.
633
694
  *
695
+ * @see {@link playDTMF} — for the app-initiated direction (programmatically play tones).
696
+ *
634
697
  * @category Call Events
635
698
  */
636
699
  export function addDTMFListener(listener) {
@@ -661,6 +724,10 @@ export function addDTMFListener(listener) {
661
724
  * });
662
725
  * ```
663
726
  *
727
+ * @see {@link getVoIPPushToken} — read the current token synchronously after registration.
728
+ * @see {@link useVoIPPushToken} — React hook that reads the token and subscribes to updates.
729
+ * @see {@link addVoIPPushTokenUpdatedListener} — non-React subscription to token updates.
730
+ *
664
731
  * @category VoIP Push
665
732
  */
666
733
  export function registerVoIPPush() {
@@ -682,6 +749,9 @@ export function registerVoIPPush() {
682
749
  * }
683
750
  * ```
684
751
  *
752
+ * @see {@link registerVoIPPush} — must be called once before a token is available.
753
+ * @see {@link useVoIPPushToken} — React hook wrapper around this + the update listener.
754
+ *
685
755
  * @category VoIP Push
686
756
  */
687
757
  export function getVoIPPushToken() {
@@ -715,6 +785,9 @@ export function getVoIPPushToken() {
715
785
  * });
716
786
  * ```
717
787
  *
788
+ * @see {@link useVoIPPushToken} — React hook that uses this internally; prefer it in components.
789
+ * @see {@link registerVoIPPush} — must be called once before any token updates fire.
790
+ *
718
791
  * @category VoIP Push
719
792
  */
720
793
  export function addVoIPPushTokenUpdatedListener(listener) {
@@ -1 +1 @@
1
- {"version":3,"file":"Calls.js","sourceRoot":"","sources":["../src/Calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA8BxC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,OAAO,GAAG,MAAM,wBAAwB,CAAC,oBAAoB,EAAE,CAAC;IACtE,IAAI,OAAO,EAAE,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAAgD;IAEhD,OAAO,wBAAwB,CAAC,WAAW,CACzC,oBAAoB,EACpB,CAAC,KAA4B,EAAE,EAAE;QAC/B,QAAQ,CAAC,KAAK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AC7C,QAAoD;IAEpD,OAAO,wBAAwB,CAAC,WAAW,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;AAClF,CAAC","sourcesContent":["/**\n * @module Calls\n *\n * This module provides APIs for managing VoIP calls with native system integration.\n * Functions are organized into three categories:\n *\n * ## Requests (Imperative)\n * Functions that initiate actions from the app. These request the system to perform\n * an operation on behalf of the user:\n * - {@link startOutgoingCall} - Start a new outgoing call\n * - {@link answerCall} - Answer an incoming call\n * - {@link endCall} - End or decline an active call\n * - {@link setMuted} - Mute/unmute the call\n * - {@link setHeld} - Hold/unhold the call\n * - {@link playDTMF} - Play DTMF tones\n *\n * ## Reporters\n * Functions that report state changes to the system. Use these to inform the system\n * about events that occurred outside of its control (e.g., from your backend or\n * media connection):\n * - {@link reportIncomingCall} - Report a new incoming call (e.g., from push notification)\n * - {@link reportOutgoingCallConnected} - Report that an outgoing call's media is connected\n * - {@link reportCallEnded} - Report that a call ended externally (e.g., remote hangup)\n * - {@link reportVideo} - Report video state changes\n *\n * ## Fulfillers\n * Functions that complete pending system requests. When the system requests an action\n * (via event listeners), your app must perform the action and then call the corresponding\n * fulfiller to confirm completion:\n * - {@link fulfillIncomingCallConnected} - Confirm that incoming call media is connected\n *\n * ## Typical Flow\n *\n * **Outgoing Call:**\n * 1. Call {@link startOutgoingCall} to initiate\n * 2. Listen for {@link addCallStartedListener} to know when to connect media\n * 3. Connect your media (e.g., WebRTC)\n * 4. Call {@link reportOutgoingCallConnected} when media is ready\n *\n * **Incoming Call:**\n * 1. Receive push notification with call data\n * 2. Call {@link reportIncomingCall} to show the incoming call UI\n * 3. Listen for {@link addCallAnsweredListener} to know when user answered\n * 4. Connect your media (e.g., WebRTC)\n * 5. Call {@link fulfillIncomingCallConnected} when media is ready\n *\n * **Ending a Call:**\n * - If user ends: Call {@link endCall} and clean up media\n * - If remote ends: Clean up media, then call {@link reportCallEnded}\n */\n\nimport type { EventSubscription } from \"expo-modules-core\";\nimport { Platform } from \"react-native\";\n\nimport type {\n AudioRouteChangedEvent,\n AudioSession,\n AudioSessionActivatedEvent,\n AudioSessionDeactivatedEvent,\n CallAnsweredEvent,\n CallEndedEvent,\n CallEndedReason,\n CallIntentReceivedEvent,\n CallOptions,\n CallParticipant,\n CallReportedEnded,\n CallSession,\n CallSessionAddedEvent,\n CallSessionRemovedEvent,\n CallSessionUpdatedEvent,\n CaptureSession,\n DTMFEvent,\n IncomingCallEvent,\n IncomingCallReportedEvent,\n OutgoingCallStartedEvent,\n SetHeldActionEvent,\n SetMutedActionEvent,\n VideoChangedEvent,\n VoIPPushToken,\n VoIPPushTokenUpdatedEvent,\n} from \"./Calls.types\";\nimport type { PushTokenType } from \"./Calls.types\";\nimport ExpoCallKitTelecomModule from \"./ExpoCallKitTelecomModule\";\n\n// ============================================================================\n// Call Session\n// ============================================================================\n\n/**\n * Gets the currently active call session, if any.\n *\n * @returns The active call session, or `null` if no call is in progress.\n *\n * @example\n * ```typescript\n * const session = await getActiveCallSession();\n * if (session) {\n * console.log('Active call with:', session.remoteParticipants[0]?.displayName);\n * }\n * ```\n *\n * @category Sessions\n */\nexport async function getActiveCallSession(): Promise<CallSession | null> {\n const session = await ExpoCallKitTelecomModule.getActiveCallSession();\n if (session) {\n }\n return session;\n}\n\n/**\n * Subscribes to call session added events.\n *\n * Fired when a new call session is created, either from an outgoing call request\n * or an incoming call report.\n *\n * @param listener - Callback invoked when a session is added.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @example\n * ```typescript\n * const subscription = addCallSessionAddedListener((event) => {\n * console.log('New call session:', event.session.id);\n * });\n *\n * // Later, to unsubscribe:\n * subscription.remove();\n * ```\n *\n * @category Sessions\n */\nexport function addCallSessionAddedListener(\n listener: (event: CallSessionAddedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\n \"onCallSessionAdded\",\n (event: CallSessionAddedEvent) => {\n listener(event);\n },\n );\n}\n\n/**\n * Subscribes to call session updated events.\n *\n * Fired when an existing call session's state changes (e.g., status, mute state).\n *\n * @param listener - Callback invoked when a session is updated.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Sessions\n */\nexport function addCallSessionUpdatedListener(\n listener: (event: CallSessionUpdatedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\n \"onCallSessionUpdated\",\n (event: CallSessionUpdatedEvent) => {\n listener(event);\n },\n );\n}\n\n/**\n * Subscribes to call session removed events.\n *\n * Fired when a call session is removed after the call has ended and been cleaned up.\n *\n * @param listener - Callback invoked when a session is removed.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Sessions\n */\nexport function addCallSessionRemovedListener(\n listener: (event: CallSessionRemovedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallSessionRemoved\", listener);\n}\n\n// ============================================================================\n// Audio Session\n// ============================================================================\n\n/**\n * Gets the current audio session state.\n *\n * Returns information about the audio session including whether it's active,\n * the current category/mode, and the audio route (speaker, earpiece, etc.).\n *\n * @returns The current audio session state.\n *\n * @category Audio\n */\nexport function getAudioSession(): AudioSession {\n return ExpoCallKitTelecomModule.getAudioSessionState();\n}\n\n/**\n * Gets the current capture session state.\n *\n * Returns information about the capture session including camera permission status.\n *\n * @returns The current capture session state.\n *\n * @category Capture\n */\nexport function getCaptureSession(): CaptureSession {\n return ExpoCallKitTelecomModule.getCaptureSessionState();\n}\n\n/**\n * Sets the RTC audio session configuration (iOS only).\n *\n * This sets up WebRTC's RTCAudioSession default configuration and enables manual\n * audio management. On Android this is a no-op — audio configuration is handled\n * by {@link prepareAudioSessionForCall}.\n *\n * @param hasVideo - Whether to configure for video calls (uses speaker by default)\n * or audio-only calls (uses earpiece by default).\n *\n * @category Audio\n */\nexport function setRTCAudioSessionConfiguration(hasVideo: boolean): void {\n if (Platform.OS === \"ios\") {\n ExpoCallKitTelecomModule.setRTCAudioSessionConfiguration(hasVideo);\n }\n}\n\n/**\n * Prepares the audio session for an upcoming call.\n *\n * This snapshots the current audio configuration (for later restoration) and\n * pre-configures the audio session for the call. Called automatically when\n * reporting/starting a call, but can be called manually for early preparation.\n *\n * @param hasVideo - Whether to configure for video calls (uses speaker by default)\n * or audio-only calls (uses earpiece by default).\n *\n * @category Audio\n */\nexport function prepareAudioSessionForCall(hasVideo: boolean): void {\n ExpoCallKitTelecomModule.prepareAudioSessionForCall(hasVideo);\n}\n\n/**\n * Restores the audio session to its pre-call configuration.\n *\n * Call this if a call fails to start after prepareAudioSessionForCall was called,\n * or to manually restore the audio session. This is called automatically when\n * the audio session is deactivated after a call ends.\n *\n * @category Audio\n */\nexport function restoreAudioSession(): void {\n ExpoCallKitTelecomModule.restoreAudioSession();\n}\n\n/**\n * Sets the audio session port override.\n *\n * Use this to route audio to the speaker instead of the earpiece, or vice versa.\n *\n * @param enabled - If `true`, routes audio to the speaker. If `false`, uses\n * the default route (typically earpiece for voice calls).\n *\n * @category Audio\n */\nexport function setAudioSessionPortOverride(enabled: boolean): void {\n ExpoCallKitTelecomModule.setAudioSessionPortOverride(enabled);\n}\n\n/**\n * Subscribes to audio session activated events.\n *\n * Fired when the audio session is activated for a call. This is when your\n * app gains exclusive access to audio hardware.\n *\n * @param listener - Callback invoked when audio session activates.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Audio Events\n */\nexport function addAudioSessionActivatedListener(\n listener: (event: AudioSessionActivatedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onAudioSessionActivated\", listener);\n}\n\n/**\n * Subscribes to audio session deactivated events.\n *\n * Fired when the audio session is deactivated after a call ends.\n *\n * @param listener - Callback invoked when audio session deactivates.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Audio Events\n */\nexport function addAudioSessionDeactivatedListener(\n listener: (event: AudioSessionDeactivatedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onAudioSessionDeactivated\", listener);\n}\n\n/**\n * Subscribes to audio route changed events.\n *\n * Fired when the audio route changes (e.g., user connects Bluetooth headphones,\n * toggles speaker mode).\n *\n * @param listener - Callback invoked when audio route changes.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Audio Events\n */\nexport function addAudioRouteChangedListener(\n listener: (event: AudioRouteChangedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onAudioRouteChanged\", listener);\n}\n\n// ============================================================================\n// Call Intent Event Listeners\n// ============================================================================\n\n/**\n * Subscribes to call intent received events.\n *\n * Fired when the user initiates a call from outside the app, such as tapping\n * a contact in the iOS Recents list or via Siri. The event contains the handle\n * (phone number/email) and whether video is requested.\n *\n * The app should resolve the handle to a known recipient and call\n * {@link startOutgoingCall} to fulfill the intent.\n *\n * @param listener - Callback invoked when a call intent is received.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addCallIntentReceivedListener(\n listener: (event: CallIntentReceivedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallIntentReceived\", listener);\n}\n\n// ============================================================================\n// Start Outgoing Call\n// ============================================================================\n\n/**\n * Starts an outgoing call to the specified recipient.\n *\n * This requests the system to initiate a call. The system will display the\n * appropriate call UI and emit an {@link OutgoingCallStartedEvent} when you should\n * begin connecting your media.\n *\n * @param recipient - The participant to call.\n * @param options - Call configuration options (e.g., video enabled).\n * @returns The unique identifier for this call session.\n *\n * @example\n * ```typescript\n * const callId = await startOutgoingCall(\n * { id: 'user-123', displayName: 'John Doe' },\n * { hasVideo: true }\n * );\n * ```\n *\n * @category Requests\n */\nexport async function startOutgoingCall(\n recipient: CallParticipant,\n options: CallOptions,\n): Promise<string> {\n return await ExpoCallKitTelecomModule.startOutgoingCall(recipient, options);\n}\n\n/**\n * Subscribes to outgoing call started events.\n *\n * Fired when an outgoing call (initiated via {@link startOutgoingCall}) has\n * been accepted by the system. You should provision your media connection\n * and begin connecting.\n *\n * @param listener - Callback invoked when an outgoing call starts.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addOutgoingCallStartedListener(\n listener: (event: OutgoingCallStartedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onOutgoingCallStarted\", listener);\n}\n\n// ============================================================================\n// Report Incoming Call\n// ============================================================================\n\n/**\n * Reports an incoming call to the system.\n *\n * Call this when you receive a push notification or other signal indicating\n * an incoming call. The system will display the incoming call UI.\n *\n * @param event - The incoming call event containing caller information.\n *\n * @example\n * ```typescript\n * await reportIncomingCall({\n * callId: '550e8400-e29b-41d4-a716-446655440000',\n * caller: {\n * id: 'user-456',\n * displayName: 'Jane Smith',\n * phoneNumber: '+1234567890',\n * },\n * hasVideo: false,\n * startedAt: new Date(),\n * });\n * ```\n *\n * @category Reporters\n */\nexport async function reportIncomingCall(\n event: IncomingCallEvent,\n): Promise<void> {\n await ExpoCallKitTelecomModule.reportIncomingCall(event);\n}\n\n/**\n * Subscribes to incoming call reported events.\n *\n * Fired after an incoming call has been successfully reported to the system\n * and the call session has been added to the store. Use this to set up\n * early subscriptions (e.g., call signaling) before the call is answered.\n *\n * @param listener - Callback invoked when an incoming call is reported.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addIncomingCallReportedListener(\n listener: (event: IncomingCallReportedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onIncomingCallReported\", listener);\n}\n\n// ============================================================================\n// Answer Call\n// ============================================================================\n\n/**\n * Answers an incoming call.\n *\n * Use this when the user taps an answer button in your app's custom UI.\n * The system will emit a {@link CallAnsweredEvent} to confirm the answer.\n *\n * @param id - The call session ID to answer.\n *\n * @category Requests\n */\nexport async function answerCall(id: string): Promise<void> {\n await ExpoCallKitTelecomModule.answerCall(id);\n}\n\n/**\n * Subscribes to call answered events.\n *\n * Fired when the user answers an incoming call (either from the system UI or\n * via {@link answerCall}). You should begin connecting your media.\n *\n * @param listener - Callback invoked when a call is answered.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addCallAnsweredListener(\n listener: (event: CallAnsweredEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallAnswered\", listener);\n}\n\n// ============================================================================\n// Fulfill Incoming Call\n// ============================================================================\n\n/**\n * Fulfills an incoming call by confirming the media connection is established.\n *\n * Call this after the user answers an incoming call and your media connection\n * (e.g., WebRTC) is fully connected and ready for audio/video.\n *\n * @param requestId - The request ID from the CallAnsweredEvent.\n *\n * @category Fulfillers\n */\nexport async function fulfillIncomingCallConnected(\n requestId: string,\n): Promise<void> {\n await ExpoCallKitTelecomModule.fulfillIncomingCallAnswered(requestId);\n}\n\n/**\n * Fails a pending incoming call connection request.\n *\n * Call this when the answer flow fails before media is connected\n * (e.g., API error). On iOS, causes CXAnswerCallAction to fail, which\n * triggers CallKit to end the call via CXEndCallAction. On Android,\n * ends the call via {@link reportCallEnded} which also cancels any\n * pending fulfill request.\n *\n * @param id - The call session ID.\n * @param requestId - The request ID from the CallAnsweredEvent.\n *\n * @category Fulfillers\n */\nexport async function failIncomingCallConnected(\n id: string,\n requestId: string,\n): Promise<void> {\n if (Platform.OS === \"ios\") {\n await ExpoCallKitTelecomModule.failIncomingCallConnected(requestId);\n } else {\n await ExpoCallKitTelecomModule.reportCallEnded(id, \"failed\");\n }\n}\n\n// ============================================================================\n// Report Outgoing Call Connected\n// ============================================================================\n\n/**\n * Reports that an outgoing call's media connection is established.\n *\n * Call this after starting an outgoing call and your media connection\n * (e.g., WebRTC) is fully connected and the remote party has answered.\n *\n * @param id - The call session ID.\n *\n * @category Reporters\n */\nexport async function reportOutgoingCallConnected(id: string): Promise<void> {\n await ExpoCallKitTelecomModule.reportOutgoingCallConnected(id);\n}\n\n// ============================================================================\n// End Call\n// ============================================================================\n\n/**\n * Ends an active call.\n *\n * Requests the system to end the call. The system will emit a {@link CallEndedEvent}\n * to notify that the call has ended. Clean up your media connection when you receive\n * this event.\n *\n * @param id - The call session ID to end.\n *\n * @category Requests\n */\nexport async function endCall(id: string): Promise<void> {\n await ExpoCallKitTelecomModule.endCall(id);\n}\n\n/**\n * Subscribes to call ended events.\n *\n * Fired when a call has ended (e.g., user pressed end button).\n * Clean up your media connection when you receive this event.\n *\n * @param listener - Callback invoked when a call ends.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addCallEndedListener(\n listener: (event: CallEndedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallEnded\", listener);\n}\n\n/**\n * Reports that a call has ended for an external reason.\n *\n * Use this when a call ends due to reasons outside the local user's control,\n * such as: remote party hung up, network failure, call declined elsewhere, etc.\n *\n * @param id - The call session ID.\n * @param reason - The reason the call ended.\n *\n * @example\n * ```typescript\n * // Remote party hung up\n * await reportCallEnded(callId, 'remoteEnded');\n *\n * // Call failed due to network error\n * await reportCallEnded(callId, 'failed');\n * ```\n *\n * @category Reporters\n */\nexport async function reportCallEnded(\n id: string,\n reason: CallEndedReason,\n): Promise<void> {\n await ExpoCallKitTelecomModule.reportCallEnded(id, reason);\n}\n\n/**\n * Subscribes to reported call ended events.\n *\n * Fired after {@link reportCallEnded} is called, confirming the system has\n * been notified of the externally-ended call.\n *\n * @param listener - Callback invoked when a call end is reported.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addReportedCallEndedListener(\n listener: (event: CallReportedEnded) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallReportedEnded\", listener);\n}\n\n// ============================================================================\n// Mute Support\n// ============================================================================\n\n/**\n * Changes the mute state of a call.\n *\n * The system will emit a {@link SetMutedActionEvent}. Apply the mute state to\n * your media connection when you receive this event.\n *\n * @param id - The call session ID.\n * @param muted - Whether the microphone should be muted.\n *\n * @category Requests\n */\nexport async function setMuted(id: string, muted: boolean): Promise<void> {\n await ExpoCallKitTelecomModule.setMuted(id, muted);\n}\n\n/**\n * Subscribes to set muted action events.\n *\n * Fired when the system requests to set the mute state (e.g., user pressed mute button).\n * Apply the change to your media connection when you receive this event.\n *\n * @param listener - Callback invoked when set muted action is requested.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addSetMutedActionListener(\n listener: (event: SetMutedActionEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onSetMutedAction\", listener);\n}\n\n// ============================================================================\n// Video Support\n// ============================================================================\n\n/**\n * Reports a video state change for a call.\n *\n * Use this to inform the system when video is enabled or disabled.\n *\n * @param id - The call session ID.\n * @param enabled - Whether video is enabled.\n *\n * @category Reporters\n */\nexport async function reportVideo(id: string, enabled: boolean): Promise<void> {\n await ExpoCallKitTelecomModule.reportVideo(id, enabled);\n}\n\n/**\n * Subscribes to video state change events.\n *\n * Fired when the video state changes for a call.\n *\n * @param listener - Callback invoked when video state changes.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addVideoChangedListener(\n listener: (event: VideoChangedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onVideoChanged\", listener);\n}\n\n// ============================================================================\n// Hold Support\n// ============================================================================\n\n/**\n * Changes the hold state of a call.\n *\n * The system will emit a {@link SetHeldActionEvent}. Apply the hold state to\n * your media connection when you receive this event.\n *\n * @param id - The call session ID.\n * @param onHold - Whether the call should be on hold.\n *\n * @category Requests\n */\nexport async function setHeld(id: string, onHold: boolean): Promise<void> {\n await ExpoCallKitTelecomModule.setHeld(id, onHold);\n}\n\n/**\n * Subscribes to set held action events.\n *\n * Fired when the system requests to set the hold state. Apply the change to\n * your media connection when you receive this event.\n *\n * @param listener - Callback invoked when set held action is requested.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addSetHeldActionListener(\n listener: (event: SetHeldActionEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onSetHeldAction\", listener);\n}\n\n// ============================================================================\n// DTMF Support\n// ============================================================================\n\n/**\n * Plays DTMF tones during a call.\n *\n * The system will emit a {@link DTMFEvent}. Send the tones through your media\n * connection when you receive this event.\n *\n * @param id - The call session ID.\n * @param digits - The DTMF digits to play (0-9, *, #).\n *\n * @category Requests\n */\nexport async function playDTMF(id: string, digits: string): Promise<void> {\n await ExpoCallKitTelecomModule.playDTMF(id, digits);\n}\n\n/**\n * Subscribes to DTMF events.\n *\n * Fired when DTMF tones should be played. Send the tones through your media\n * connection when you receive this event.\n *\n * @param listener - Callback invoked when DTMF tones should be played.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addDTMFListener(\n listener: (event: DTMFEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onDTMF\", listener);\n}\n\n// ============================================================================\n// VoIP Push\n// ============================================================================\n\n/**\n * Registers for VoIP push notifications.\n *\n * Call this early in your app lifecycle to receive VoIP push notifications\n * for incoming calls. Once registered, the device token will be available\n * via {@link getVoIPPushToken} and token updates will be emitted via\n * {@link addVoIPPushTokenUpdatedListener}.\n *\n * @example\n * ```typescript\n * // Register early in app initialization\n * registerVoIPPush();\n *\n * // Listen for token updates\n * addVoIPPushTokenUpdatedListener((event) => {\n * if (event.token) {\n * // Send token to your backend\n * sendTokenToBackend(event.token);\n * }\n * });\n * ```\n *\n * @category VoIP Push\n */\nexport function registerVoIPPush(): void {\n ExpoCallKitTelecomModule.registerVoIPPush();\n}\n\n/**\n * Gets the current VoIP push token and its type.\n *\n * The token should be sent to your backend along with the token type\n * so the server knows how to deliver incoming call pushes.\n *\n * @returns The VoIP push token bundled with its type, or null if not yet registered.\n *\n * @example\n * ```typescript\n * const voip = getVoIPPushToken();\n * if (voip) {\n * await sendTokenToBackend(voip.token, voip.type);\n * }\n * ```\n *\n * @category VoIP Push\n */\nexport function getVoIPPushToken(): VoIPPushToken | null {\n const result = ExpoCallKitTelecomModule.getVoIPPushToken();\n if (!result.token) return null;\n return {\n token: result.token,\n type: result.type as PushTokenType,\n };\n}\n\n/**\n * Subscribes to VoIP token updated events.\n *\n * Fired when the VoIP push token is received or updated after calling\n * {@link registerVoIPPush}. Also fired if the token is invalidated (with\n * `token` being `undefined`).\n *\n * @param listener - Callback invoked when the VoIP token updates.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @example\n * ```typescript\n * const subscription = addVoIPPushTokenUpdatedListener((event) => {\n * if (event.token) {\n * console.log('New VoIP token:', event.token);\n * sendTokenToBackend(event.token);\n * } else {\n * console.log('VoIP token invalidated');\n * }\n * });\n * ```\n *\n * @category VoIP Push\n */\nexport function addVoIPPushTokenUpdatedListener(\n listener: (event: VoIPPushTokenUpdatedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onVoIPPushTokenUpdated\", listener);\n}\n"]}
1
+ {"version":3,"file":"Calls.js","sourceRoot":"","sources":["../src/Calls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA8BxC,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,OAAO,GAAG,MAAM,wBAAwB,CAAC,oBAAoB,EAAE,CAAC;IACtE,IAAI,OAAO,EAAE,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAAgD;IAEhD,OAAO,wBAAwB,CAAC,WAAW,CACzC,oBAAoB,EACpB,CAAC,KAA4B,EAAE,EAAE;QAC/B,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CACF,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAkD;IAElD,OAAO,w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,wBAAwB,CAAC,WAAW,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;AAClF,CAAC","sourcesContent":["/**\n * @module Calls\n *\n * This module provides APIs for managing VoIP calls with native system integration.\n * Functions are organized into three categories:\n *\n * ## Requests (Imperative)\n * Functions that initiate actions from the app. These request the system to perform\n * an operation on behalf of the user:\n * - {@link startOutgoingCall} - Start a new outgoing call\n * - {@link answerCall} - Answer an incoming call\n * - {@link endCall} - End or decline an active call\n * - {@link setMuted} - Mute/unmute the call\n * - {@link setHeld} - Hold/unhold the call\n * - {@link playDTMF} - Play DTMF tones\n *\n * ## Reporters\n * Functions that report state changes to the system. Use these to inform the system\n * about events that occurred outside of its control (e.g., from your backend or\n * media connection):\n * - {@link reportIncomingCall} - Report a new incoming call (e.g., from push notification)\n * - {@link reportOutgoingCallConnected} - Report that an outgoing call's media is connected\n * - {@link reportCallEnded} - Report that a call ended externally (e.g., remote hangup)\n * - {@link reportVideo} - Report video state changes\n *\n * ## Fulfillers\n * Functions that complete pending system requests. When the system requests an action\n * (via event listeners), your app must perform the action and then call the corresponding\n * fulfiller to confirm completion:\n * - {@link fulfillIncomingCallConnected} - Confirm that incoming call media is connected\n *\n * ## Typical Flow\n *\n * **Outgoing Call:**\n * 1. Call {@link startOutgoingCall} to initiate\n * 2. Listen for {@link addCallStartedListener} to know when to connect media\n * 3. Connect your media (e.g., WebRTC)\n * 4. Call {@link reportOutgoingCallConnected} when media is ready\n *\n * **Incoming Call:**\n * 1. Receive push notification with call data\n * 2. Call {@link reportIncomingCall} to show the incoming call UI\n * 3. Listen for {@link addCallAnsweredListener} to know when user answered\n * 4. Connect your media (e.g., WebRTC)\n * 5. Call {@link fulfillIncomingCallConnected} when media is ready\n *\n * **Ending a Call:**\n * - If user ends: Call {@link endCall} and clean up media\n * - If remote ends: Clean up media, then call {@link reportCallEnded}\n */\n\nimport type { EventSubscription } from \"expo-modules-core\";\nimport { Platform } from \"react-native\";\n\nimport type {\n AudioRouteChangedEvent,\n AudioSession,\n AudioSessionActivatedEvent,\n AudioSessionDeactivatedEvent,\n CallAnsweredEvent,\n CallEndedEvent,\n CallEndedReason,\n CallIntentReceivedEvent,\n CallOptions,\n CallParticipant,\n CallReportedEnded,\n CallSession,\n CallSessionAddedEvent,\n CallSessionRemovedEvent,\n CallSessionUpdatedEvent,\n CaptureSession,\n DTMFEvent,\n IncomingCallEvent,\n IncomingCallReportedEvent,\n OutgoingCallStartedEvent,\n SetHeldActionEvent,\n SetMutedActionEvent,\n VideoChangedEvent,\n VoIPPushToken,\n VoIPPushTokenUpdatedEvent,\n} from \"./Calls.types\";\nimport type { PushTokenType } from \"./Calls.types\";\nimport ExpoCallKitTelecomModule from \"./ExpoCallKitTelecomModule\";\n\n// ============================================================================\n// Call Session\n// ============================================================================\n\n/**\n * Gets the currently active call session, if any.\n *\n * @returns The active call session, or `null` if no call is in progress.\n *\n * @example\n * ```typescript\n * const session = await getActiveCallSession();\n * if (session) {\n * console.log('Active call with:', session.remoteParticipants[0]?.displayName);\n * }\n * ```\n *\n * @category Sessions\n */\nexport async function getActiveCallSession(): Promise<CallSession | null> {\n const session = await ExpoCallKitTelecomModule.getActiveCallSession();\n if (session) {\n }\n return session;\n}\n\n/**\n * Subscribes to call session added events.\n *\n * Fired when a new call session is created, either from an outgoing call request\n * or an incoming call report.\n *\n * @param listener - Callback invoked when a session is added.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @example\n * ```typescript\n * const subscription = addCallSessionAddedListener((event) => {\n * console.log('New call session:', event.session.id);\n * });\n *\n * // Later, to unsubscribe:\n * subscription.remove();\n * ```\n *\n * @category Sessions\n */\nexport function addCallSessionAddedListener(\n listener: (event: CallSessionAddedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\n \"onCallSessionAdded\",\n (event: CallSessionAddedEvent) => {\n listener(event);\n },\n );\n}\n\n/**\n * Subscribes to call session updated events.\n *\n * Fired when an existing call session's state changes (e.g., status, mute state).\n *\n * @param listener - Callback invoked when a session is updated.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Sessions\n */\nexport function addCallSessionUpdatedListener(\n listener: (event: CallSessionUpdatedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\n \"onCallSessionUpdated\",\n (event: CallSessionUpdatedEvent) => {\n listener(event);\n },\n );\n}\n\n/**\n * Subscribes to call session removed events.\n *\n * Fired when a call session is removed after the call has ended and been cleaned up.\n *\n * @param listener - Callback invoked when a session is removed.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Sessions\n */\nexport function addCallSessionRemovedListener(\n listener: (event: CallSessionRemovedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallSessionRemoved\", listener);\n}\n\n// ============================================================================\n// Audio Session\n// ============================================================================\n\n/**\n * Gets the current audio session state.\n *\n * Returns information about the audio session including whether it's active,\n * the current category/mode, and the audio route (speaker, earpiece, etc.).\n *\n * @returns The current audio session state.\n *\n * @category Audio\n */\nexport function getAudioSession(): AudioSession {\n return ExpoCallKitTelecomModule.getAudioSessionState();\n}\n\n/**\n * Gets the current capture session state.\n *\n * Returns information about the capture session including camera permission status.\n *\n * @returns The current capture session state.\n *\n * @category Capture\n */\nexport function getCaptureSession(): CaptureSession {\n return ExpoCallKitTelecomModule.getCaptureSessionState();\n}\n\n/**\n * Sets the RTC audio session configuration (iOS only).\n *\n * This sets up WebRTC's RTCAudioSession default configuration and enables manual\n * audio management. On Android this is a no-op — audio configuration is handled\n * by {@link prepareAudioSessionForCall}.\n *\n * @param hasVideo - Whether to configure for video calls (uses speaker by default)\n * or audio-only calls (uses earpiece by default).\n *\n * @category Audio\n */\nexport function setRTCAudioSessionConfiguration(hasVideo: boolean): void {\n if (Platform.OS === \"ios\") {\n ExpoCallKitTelecomModule.setRTCAudioSessionConfiguration(hasVideo);\n }\n}\n\n/**\n * Prepares the audio session for an upcoming call.\n *\n * This snapshots the current audio configuration (for later restoration) and\n * pre-configures the audio session for the call. Called automatically when\n * reporting/starting a call, but can be called manually for early preparation.\n *\n * @param hasVideo - Whether to configure for video calls (uses speaker by default)\n * or audio-only calls (uses earpiece by default).\n *\n * @see {@link restoreAudioSession} — call this after the call ends to revert the session configuration.\n * @see {@link getAudioSession} — inspect the resulting audio session state.\n *\n * @category Audio\n */\nexport function prepareAudioSessionForCall(hasVideo: boolean): void {\n ExpoCallKitTelecomModule.prepareAudioSessionForCall(hasVideo);\n}\n\n/**\n * Restores the audio session to its pre-call configuration.\n *\n * Call this if a call fails to start after prepareAudioSessionForCall was called,\n * or to manually restore the audio session. This is called automatically when\n * the audio session is deactivated after a call ends.\n *\n * @see {@link prepareAudioSessionForCall} — the matching setup call.\n *\n * @category Audio\n */\nexport function restoreAudioSession(): void {\n ExpoCallKitTelecomModule.restoreAudioSession();\n}\n\n/**\n * Sets the audio session port override.\n *\n * Use this to route audio to the speaker instead of the earpiece, or vice versa.\n *\n * @param enabled - If `true`, routes audio to the speaker. If `false`, uses\n * the default route (typically earpiece for voice calls).\n *\n * @category Audio\n */\nexport function setAudioSessionPortOverride(enabled: boolean): void {\n ExpoCallKitTelecomModule.setAudioSessionPortOverride(enabled);\n}\n\n/**\n * Subscribes to audio session activated events.\n *\n * Fired when the audio session is activated for a call. This is when your\n * app gains exclusive access to audio hardware.\n *\n * @param listener - Callback invoked when audio session activates.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Audio Events\n */\nexport function addAudioSessionActivatedListener(\n listener: (event: AudioSessionActivatedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onAudioSessionActivated\", listener);\n}\n\n/**\n * Subscribes to audio session deactivated events.\n *\n * Fired when the audio session is deactivated after a call ends.\n *\n * @param listener - Callback invoked when audio session deactivates.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Audio Events\n */\nexport function addAudioSessionDeactivatedListener(\n listener: (event: AudioSessionDeactivatedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onAudioSessionDeactivated\", listener);\n}\n\n/**\n * Subscribes to audio route changed events.\n *\n * Fired when the audio route changes (e.g., user connects Bluetooth headphones,\n * toggles speaker mode).\n *\n * @param listener - Callback invoked when audio route changes.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Audio Events\n */\nexport function addAudioRouteChangedListener(\n listener: (event: AudioRouteChangedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onAudioRouteChanged\", listener);\n}\n\n// ============================================================================\n// Call Intent Event Listeners\n// ============================================================================\n\n/**\n * Subscribes to call intent received events.\n *\n * Fired when the user initiates a call from outside the app, such as tapping\n * a contact in the iOS Recents list or via Siri. The event contains the handle\n * (phone number/email) and whether video is requested.\n *\n * The app should resolve the handle to a known recipient and call\n * {@link startOutgoingCall} to fulfill the intent.\n *\n * @param listener - Callback invoked when a call intent is received.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @category Call Events\n */\nexport function addCallIntentReceivedListener(\n listener: (event: CallIntentReceivedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallIntentReceived\", listener);\n}\n\n// ============================================================================\n// Start Outgoing Call\n// ============================================================================\n\n/**\n * Starts an outgoing call to the specified recipient.\n *\n * This requests the system to initiate a call. The system will display the\n * appropriate call UI and emit an {@link OutgoingCallStartedEvent} when you should\n * begin connecting your media.\n *\n * @param recipient - The participant to call.\n * @param options - Call configuration options (e.g., video enabled).\n * @returns The unique identifier for this call session.\n *\n * @example\n * ```typescript\n * const callId = await startOutgoingCall(\n * { id: 'user-123', displayName: 'John Doe' },\n * { hasVideo: true }\n * );\n * ```\n *\n * @see {@link addOutgoingCallStartedListener} for the event fired once the OS accepts the call.\n * @see {@link reportOutgoingCallConnected} to call after the remote media stream is established.\n * @see {@link endCall} to terminate the call from the app.\n *\n * @category Requests\n */\nexport async function startOutgoingCall(\n recipient: CallParticipant,\n options: CallOptions,\n): Promise<string> {\n return await ExpoCallKitTelecomModule.startOutgoingCall(recipient, options);\n}\n\n/**\n * Subscribes to outgoing call started events.\n *\n * Fired when an outgoing call (initiated via {@link startOutgoingCall}) has\n * been accepted by the system. You should provision your media connection\n * and begin connecting.\n *\n * @param listener - Callback invoked when an outgoing call starts.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @see {@link startOutgoingCall} — the request that triggers this event.\n * @see {@link reportOutgoingCallConnected} — the next step in the outgoing-call flow.\n *\n * @category Call Events\n */\nexport function addOutgoingCallStartedListener(\n listener: (event: OutgoingCallStartedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onOutgoingCallStarted\", listener);\n}\n\n// ============================================================================\n// Report Incoming Call\n// ============================================================================\n\n/**\n * Reports an incoming call to the system.\n *\n * Call this when you receive a push notification or other signal indicating\n * an incoming call. The system will display the incoming call UI.\n *\n * @param event - The incoming call event containing caller information.\n *\n * @example\n * ```typescript\n * await reportIncomingCall({\n * callId: '550e8400-e29b-41d4-a716-446655440000',\n * caller: {\n * id: 'user-456',\n * displayName: 'Jane Smith',\n * phoneNumber: '+1234567890',\n * },\n * hasVideo: false,\n * startedAt: new Date(),\n * });\n * ```\n *\n * @see {@link addIncomingCallReportedListener} — fires once the OS accepts the report.\n * @see {@link addCallAnsweredListener} — fires when the user answers from the system UI.\n * @see [VoIP push payload shape](https://mfairley.github.io/expo-callkit-telecom/voip-push) — the payload that drives this when called from a native push handler.\n *\n * @category Reporters\n */\nexport async function reportIncomingCall(\n event: IncomingCallEvent,\n): Promise<void> {\n await ExpoCallKitTelecomModule.reportIncomingCall(event);\n}\n\n/**\n * Subscribes to incoming call reported events.\n *\n * Fired after an incoming call has been successfully reported to the system\n * and the call session has been added to the store. Use this to set up\n * early subscriptions (e.g., call signaling) before the call is answered.\n *\n * @param listener - Callback invoked when an incoming call is reported.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @see {@link reportIncomingCall} — the report that triggers this event.\n * @see {@link addCallAnsweredListener} — fires when the user answers from the system UI.\n *\n * @category Call Events\n */\nexport function addIncomingCallReportedListener(\n listener: (event: IncomingCallReportedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onIncomingCallReported\", listener);\n}\n\n// ============================================================================\n// Answer Call\n// ============================================================================\n\n/**\n * Answers an incoming call.\n *\n * Use this when the user taps an answer button in your app's custom UI.\n * The system will emit a {@link CallAnsweredEvent} to confirm the answer.\n *\n * @param id - The call session ID to answer.\n *\n * @see {@link addCallAnsweredListener} — react to user-initiated answers from the system UI; most apps listen here rather than calling this directly.\n * @see {@link fulfillIncomingCallConnected} — call after media is established.\n * @see {@link failIncomingCallConnected} — call if media setup fails.\n *\n * @category Requests\n */\nexport async function answerCall(id: string): Promise<void> {\n await ExpoCallKitTelecomModule.answerCall(id);\n}\n\n/**\n * Subscribes to call answered events.\n *\n * Fired when the user answers an incoming call (either from the system UI or\n * via {@link answerCall}). You should begin connecting your media.\n *\n * @param listener - Callback invoked when a call is answered.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @see {@link answerCall} — the programmatic equivalent (rarely needed; usually the OS UI triggers answering).\n * @see {@link fulfillIncomingCallConnected} — call after media setup completes.\n * @see {@link failIncomingCallConnected} — call if media setup fails.\n *\n * @category Call Events\n */\nexport function addCallAnsweredListener(\n listener: (event: CallAnsweredEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallAnswered\", listener);\n}\n\n// ============================================================================\n// Fulfill Incoming Call\n// ============================================================================\n\n/**\n * Fulfills an incoming call by confirming the media connection is established.\n *\n * Call this after the user answers an incoming call and your media connection\n * (e.g., WebRTC) is fully connected and ready for audio/video.\n *\n * @param requestId - The request ID from the CallAnsweredEvent.\n *\n * @see {@link addCallAnsweredListener} — the event you typically respond to before calling this.\n * @see {@link failIncomingCallConnected} — call this instead if media setup fails.\n *\n * @category Fulfillers\n */\nexport async function fulfillIncomingCallConnected(\n requestId: string,\n): Promise<void> {\n await ExpoCallKitTelecomModule.fulfillIncomingCallAnswered(requestId);\n}\n\n/**\n * Fails a pending incoming call connection request.\n *\n * Call this when the answer flow fails before media is connected\n * (e.g., API error). On iOS, causes CXAnswerCallAction to fail, which\n * triggers CallKit to end the call via CXEndCallAction. On Android,\n * ends the call via {@link reportCallEnded} which also cancels any\n * pending fulfill request.\n *\n * @param id - The call session ID.\n * @param requestId - The request ID from the CallAnsweredEvent.\n *\n * @see {@link fulfillIncomingCallConnected} — call this on the success path.\n * @see {@link addCallAnsweredListener} — the event you typically respond to before calling either fulfiller.\n *\n * @category Fulfillers\n */\nexport async function failIncomingCallConnected(\n id: string,\n requestId: string,\n): Promise<void> {\n if (Platform.OS === \"ios\") {\n await ExpoCallKitTelecomModule.failIncomingCallConnected(requestId);\n } else {\n await ExpoCallKitTelecomModule.reportCallEnded(id, \"failed\");\n }\n}\n\n// ============================================================================\n// Report Outgoing Call Connected\n// ============================================================================\n\n/**\n * Reports that an outgoing call's media connection is established.\n *\n * Call this after starting an outgoing call and your media connection\n * (e.g., WebRTC) is fully connected and the remote party has answered.\n *\n * @param id - The call session ID.\n *\n * @see {@link startOutgoingCall} — the call that initiated this outgoing flow.\n * @see {@link addOutgoingCallStartedListener} — fires when the OS accepts the request.\n *\n * @category Reporters\n */\nexport async function reportOutgoingCallConnected(id: string): Promise<void> {\n await ExpoCallKitTelecomModule.reportOutgoingCallConnected(id);\n}\n\n// ============================================================================\n// End Call\n// ============================================================================\n\n/**\n * Ends an active call.\n *\n * Requests the system to end the call. The system will emit a {@link CallEndedEvent}\n * to notify that the call has ended. Clean up your media connection when you receive\n * this event.\n *\n * @param id - The call session ID to end.\n *\n * @see {@link addCallEndedListener} — confirms the call ended.\n * @see {@link reportCallEnded} — call this instead when the remote party hung up (a server-side signal), so the OS records the right reason.\n *\n * @category Requests\n */\nexport async function endCall(id: string): Promise<void> {\n await ExpoCallKitTelecomModule.endCall(id);\n}\n\n/**\n * Subscribes to call ended events.\n *\n * Fired when a call has ended (e.g., user pressed end button).\n * Clean up your media connection when you receive this event.\n *\n * @param listener - Callback invoked when a call ends.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @see {@link endCall} — the app-side request that fires this when the user ends from your UI.\n * @see {@link reportCallEnded} — for remote-initiated ends (server tells you the other party hung up).\n *\n * @category Call Events\n */\nexport function addCallEndedListener(\n listener: (event: CallEndedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallEnded\", listener);\n}\n\n/**\n * Reports that a call has ended for an external reason.\n *\n * Use this when a call ends due to reasons outside the local user's control,\n * such as: remote party hung up, network failure, call declined elsewhere, etc.\n *\n * @param id - The call session ID.\n * @param reason - The reason the call ended.\n *\n * @example\n * ```typescript\n * // Remote party hung up\n * await reportCallEnded(callId, 'remoteEnded');\n *\n * // Call failed due to network error\n * await reportCallEnded(callId, 'failed');\n * ```\n *\n * @see {@link endCall} — the app-initiated path (your user ended the call).\n * @see {@link addReportedCallEndedListener} — confirms the OS accepted the report.\n *\n * @category Reporters\n */\nexport async function reportCallEnded(\n id: string,\n reason: CallEndedReason,\n): Promise<void> {\n await ExpoCallKitTelecomModule.reportCallEnded(id, reason);\n}\n\n/**\n * Subscribes to reported call ended events.\n *\n * Fired after {@link reportCallEnded} is called, confirming the system has\n * been notified of the externally-ended call.\n *\n * @param listener - Callback invoked when a call end is reported.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @see {@link reportCallEnded} — the report that triggers this event.\n *\n * @category Call Events\n */\nexport function addReportedCallEndedListener(\n listener: (event: CallReportedEnded) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onCallReportedEnded\", listener);\n}\n\n// ============================================================================\n// Mute Support\n// ============================================================================\n\n/**\n * Changes the mute state of a call.\n *\n * The system will emit a {@link SetMutedActionEvent}. Apply the mute state to\n * your media connection when you receive this event.\n *\n * @param id - The call session ID.\n * @param muted - Whether the microphone should be muted.\n *\n * @see {@link addSetMutedActionListener} — fires when the system requests a mute change (e.g. the user pressed mute in the CallKit UI); apply the change to your media stream from there.\n *\n * @category Requests\n */\nexport async function setMuted(id: string, muted: boolean): Promise<void> {\n await ExpoCallKitTelecomModule.setMuted(id, muted);\n}\n\n/**\n * Subscribes to set muted action events.\n *\n * Fired when the system requests to set the mute state (e.g., user pressed mute button).\n * Apply the change to your media connection when you receive this event.\n *\n * @param listener - Callback invoked when set muted action is requested.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @see {@link setMuted} — for the app-initiated direction (programmatic mute toggle).\n *\n * @category Call Events\n */\nexport function addSetMutedActionListener(\n listener: (event: SetMutedActionEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onSetMutedAction\", listener);\n}\n\n// ============================================================================\n// Video Support\n// ============================================================================\n\n/**\n * Reports a video state change for a call.\n *\n * Use this to inform the system when video is enabled or disabled.\n *\n * @param id - The call session ID.\n * @param enabled - Whether video is enabled.\n *\n * @see {@link addVideoChangedListener} — the inverse direction (system-side video state changes).\n *\n * @category Reporters\n */\nexport async function reportVideo(id: string, enabled: boolean): Promise<void> {\n await ExpoCallKitTelecomModule.reportVideo(id, enabled);\n}\n\n/**\n * Subscribes to video state change events.\n *\n * Fired when the video state changes for a call.\n *\n * @param listener - Callback invoked when video state changes.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @see {@link reportVideo} — for reporting your app's video state changes back to the system.\n *\n * @category Call Events\n */\nexport function addVideoChangedListener(\n listener: (event: VideoChangedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onVideoChanged\", listener);\n}\n\n// ============================================================================\n// Hold Support\n// ============================================================================\n\n/**\n * Changes the hold state of a call.\n *\n * The system will emit a {@link SetHeldActionEvent}. Apply the hold state to\n * your media connection when you receive this event.\n *\n * @param id - The call session ID.\n * @param onHold - Whether the call should be on hold.\n *\n * @see {@link addSetHeldActionListener} — fires when the system requests a hold-state change.\n *\n * @category Requests\n */\nexport async function setHeld(id: string, onHold: boolean): Promise<void> {\n await ExpoCallKitTelecomModule.setHeld(id, onHold);\n}\n\n/**\n * Subscribes to set held action events.\n *\n * Fired when the system requests to set the hold state. Apply the change to\n * your media connection when you receive this event.\n *\n * @param listener - Callback invoked when set held action is requested.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @see {@link setHeld} — for the app-initiated direction.\n *\n * @category Call Events\n */\nexport function addSetHeldActionListener(\n listener: (event: SetHeldActionEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onSetHeldAction\", listener);\n}\n\n// ============================================================================\n// DTMF Support\n// ============================================================================\n\n/**\n * Plays DTMF tones during a call.\n *\n * The system will emit a {@link DTMFEvent}. Send the tones through your media\n * connection when you receive this event.\n *\n * @param id - The call session ID.\n * @param digits - The DTMF digits to play (0-9, *, #).\n *\n * @see {@link addDTMFListener} — fires when the system requests DTMF tones (e.g. from the in-call keypad).\n *\n * @category Requests\n */\nexport async function playDTMF(id: string, digits: string): Promise<void> {\n await ExpoCallKitTelecomModule.playDTMF(id, digits);\n}\n\n/**\n * Subscribes to DTMF events.\n *\n * Fired when DTMF tones should be played. Send the tones through your media\n * connection when you receive this event.\n *\n * @param listener - Callback invoked when DTMF tones should be played.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @see {@link playDTMF} — for the app-initiated direction (programmatically play tones).\n *\n * @category Call Events\n */\nexport function addDTMFListener(\n listener: (event: DTMFEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onDTMF\", listener);\n}\n\n// ============================================================================\n// VoIP Push\n// ============================================================================\n\n/**\n * Registers for VoIP push notifications.\n *\n * Call this early in your app lifecycle to receive VoIP push notifications\n * for incoming calls. Once registered, the device token will be available\n * via {@link getVoIPPushToken} and token updates will be emitted via\n * {@link addVoIPPushTokenUpdatedListener}.\n *\n * @example\n * ```typescript\n * // Register early in app initialization\n * registerVoIPPush();\n *\n * // Listen for token updates\n * addVoIPPushTokenUpdatedListener((event) => {\n * if (event.token) {\n * // Send token to your backend\n * sendTokenToBackend(event.token);\n * }\n * });\n * ```\n *\n * @see {@link getVoIPPushToken} — read the current token synchronously after registration.\n * @see {@link useVoIPPushToken} — React hook that reads the token and subscribes to updates.\n * @see {@link addVoIPPushTokenUpdatedListener} — non-React subscription to token updates.\n *\n * @category VoIP Push\n */\nexport function registerVoIPPush(): void {\n ExpoCallKitTelecomModule.registerVoIPPush();\n}\n\n/**\n * Gets the current VoIP push token and its type.\n *\n * The token should be sent to your backend along with the token type\n * so the server knows how to deliver incoming call pushes.\n *\n * @returns The VoIP push token bundled with its type, or null if not yet registered.\n *\n * @example\n * ```typescript\n * const voip = getVoIPPushToken();\n * if (voip) {\n * await sendTokenToBackend(voip.token, voip.type);\n * }\n * ```\n *\n * @see {@link registerVoIPPush} — must be called once before a token is available.\n * @see {@link useVoIPPushToken} — React hook wrapper around this + the update listener.\n *\n * @category VoIP Push\n */\nexport function getVoIPPushToken(): VoIPPushToken | null {\n const result = ExpoCallKitTelecomModule.getVoIPPushToken();\n if (!result.token) return null;\n return {\n token: result.token,\n type: result.type as PushTokenType,\n };\n}\n\n/**\n * Subscribes to VoIP token updated events.\n *\n * Fired when the VoIP push token is received or updated after calling\n * {@link registerVoIPPush}. Also fired if the token is invalidated (with\n * `token` being `undefined`).\n *\n * @param listener - Callback invoked when the VoIP token updates.\n * @returns A subscription that can be removed by calling `.remove()`.\n *\n * @example\n * ```typescript\n * const subscription = addVoIPPushTokenUpdatedListener((event) => {\n * if (event.token) {\n * console.log('New VoIP token:', event.token);\n * sendTokenToBackend(event.token);\n * } else {\n * console.log('VoIP token invalidated');\n * }\n * });\n * ```\n *\n * @see {@link useVoIPPushToken} — React hook that uses this internally; prefer it in components.\n * @see {@link registerVoIPPush} — must be called once before any token updates fire.\n *\n * @category VoIP Push\n */\nexport function addVoIPPushTokenUpdatedListener(\n listener: (event: VoIPPushTokenUpdatedEvent) => void,\n): EventSubscription {\n return ExpoCallKitTelecomModule.addListener(\"onVoIPPushTokenUpdated\", listener);\n}\n"]}
@@ -10,6 +10,10 @@ import type { VoIPPushToken } from "../Calls.types";
10
10
  *
11
11
  * @returns The current token, or `null` if not yet available.
12
12
  *
13
+ * @see {@link registerVoIPPush} — must be called once before any token will be available.
14
+ * @see {@link getVoIPPushToken} — non-hook accessor for the same token.
15
+ * @see {@link addVoIPPushTokenUpdatedListener} — the underlying subscription.
16
+ *
13
17
  * @category Hooks
14
18
  */
15
19
  export declare function useVoIPPushToken(): VoIPPushToken | null;
@@ -1 +1 @@
1
- {"version":3,"file":"useVoIPPushToken.d.ts","sourceRoot":"","sources":["../../src/hooks/useVoIPPushToken.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEnE;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAiBvD"}
1
+ {"version":3,"file":"useVoIPPushToken.d.ts","sourceRoot":"","sources":["../../src/hooks/useVoIPPushToken.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAiBvD"}
@@ -11,6 +11,10 @@ import { addVoIPPushTokenUpdatedListener, getVoIPPushToken } from "../Calls";
11
11
  *
12
12
  * @returns The current token, or `null` if not yet available.
13
13
  *
14
+ * @see {@link registerVoIPPush} — must be called once before any token will be available.
15
+ * @see {@link getVoIPPushToken} — non-hook accessor for the same token.
16
+ * @see {@link addVoIPPushTokenUpdatedListener} — the underlying subscription.
17
+ *
14
18
  * @category Hooks
15
19
  */
16
20
  export function useVoIPPushToken() {
@@ -1 +1 @@
1
- {"version":3,"file":"useVoIPPushToken.js","sourceRoot":"","sources":["../../src/hooks/useVoIPPushToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,+BAA+B,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG7E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAuB,GAAG,EAAE,CAC5D,gBAAgB,EAAE,CACnB,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,+BAA+B,CAAC,CAAC,KAAK,EAAE,EAAE;YAC7D,QAAQ,CACN,KAAK,CAAC,KAAK;gBACT,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAqB,EAAE;gBAC3D,CAAC,CAAC,IAAI,CACT,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport { addVoIPPushTokenUpdatedListener, getVoIPPushToken } from \"../Calls\";\nimport type { PushTokenType, VoIPPushToken } from \"../Calls.types\";\n\n/**\n * Hook that returns the current VoIP push token and subscribes to updates.\n *\n * Reads the initial token synchronously and re-renders whenever the native\n * `onVoIPPushTokenUpdated` event fires (e.g. when the OS provides a new token\n * or invalidates the existing one).\n *\n * On iOS this returns an APNs VoIP token; on Android it returns an FCM token.\n *\n * @returns The current token, or `null` if not yet available.\n *\n * @category Hooks\n */\nexport function useVoIPPushToken(): VoIPPushToken | null {\n const [token, setToken] = useState<VoIPPushToken | null>(() =>\n getVoIPPushToken(),\n );\n\n useEffect(() => {\n const subscription = addVoIPPushTokenUpdatedListener((event) => {\n setToken(\n event.token\n ? { token: event.token, type: event.type as PushTokenType }\n : null,\n );\n });\n return () => subscription.remove();\n }, []);\n\n return token;\n}\n"]}
1
+ {"version":3,"file":"useVoIPPushToken.js","sourceRoot":"","sources":["../../src/hooks/useVoIPPushToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,+BAA+B,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG7E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAuB,GAAG,EAAE,CAC5D,gBAAgB,EAAE,CACnB,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,+BAA+B,CAAC,CAAC,KAAK,EAAE,EAAE;YAC7D,QAAQ,CACN,KAAK,CAAC,KAAK;gBACT,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAqB,EAAE;gBAC3D,CAAC,CAAC,IAAI,CACT,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport { addVoIPPushTokenUpdatedListener, getVoIPPushToken } from \"../Calls\";\nimport type { PushTokenType, VoIPPushToken } from \"../Calls.types\";\n\n/**\n * Hook that returns the current VoIP push token and subscribes to updates.\n *\n * Reads the initial token synchronously and re-renders whenever the native\n * `onVoIPPushTokenUpdated` event fires (e.g. when the OS provides a new token\n * or invalidates the existing one).\n *\n * On iOS this returns an APNs VoIP token; on Android it returns an FCM token.\n *\n * @returns The current token, or `null` if not yet available.\n *\n * @see {@link registerVoIPPush} — must be called once before any token will be available.\n * @see {@link getVoIPPushToken} — non-hook accessor for the same token.\n * @see {@link addVoIPPushTokenUpdatedListener} — the underlying subscription.\n *\n * @category Hooks\n */\nexport function useVoIPPushToken(): VoIPPushToken | null {\n const [token, setToken] = useState<VoIPPushToken | null>(() =>\n getVoIPPushToken(),\n );\n\n useEffect(() => {\n const subscription = addVoIPPushTokenUpdatedListener((event) => {\n setToken(\n event.token\n ? { token: event.token, type: event.type as PushTokenType }\n : null,\n );\n });\n return () => subscription.remove();\n }, []);\n\n return token;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-callkit-telecom",
3
- "version": "0.2.7",
3
+ "version": "0.3.0",
4
4
  "description": "CallKit + Jetpack Core-Telecom for Expo / React Native — native call UI, VoIP push, LiveKit-friendly audio. A modern react-native-callkeep alternative.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3
+ "packages": {
4
+ ".": {
5
+ "release-type": "node",
6
+ "package-name": "expo-callkit-telecom",
7
+ "changelog-path": "CHANGELOG.md",
8
+ "include-component-in-tag": false,
9
+ "include-v-in-tag": true,
10
+ "draft": false,
11
+ "prerelease": false,
12
+ "changelog-sections": [
13
+ { "type": "feat", "section": "Features", "hidden": false },
14
+ { "type": "fix", "section": "Bug Fixes", "hidden": false },
15
+ { "type": "perf", "section": "Performance", "hidden": false },
16
+ { "type": "deps", "section": "Dependencies", "hidden": false },
17
+ { "type": "revert", "section": "Reverts", "hidden": false },
18
+ { "type": "docs", "section": "Documentation", "hidden": false },
19
+ { "type": "refactor", "section": "Code Refactoring", "hidden": true },
20
+ { "type": "test", "section": "Tests", "hidden": true },
21
+ { "type": "build", "section": "Build", "hidden": true },
22
+ { "type": "ci", "section": "CI/CD", "hidden": true },
23
+ { "type": "chore", "section": "Chores", "hidden": true },
24
+ { "type": "style", "section": "Styles", "hidden": true }
25
+ ]
26
+ }
27
+ }
28
+ }
package/src/Calls.ts CHANGED
@@ -236,6 +236,9 @@ export function setRTCAudioSessionConfiguration(hasVideo: boolean): void {
236
236
  * @param hasVideo - Whether to configure for video calls (uses speaker by default)
237
237
  * or audio-only calls (uses earpiece by default).
238
238
  *
239
+ * @see {@link restoreAudioSession} — call this after the call ends to revert the session configuration.
240
+ * @see {@link getAudioSession} — inspect the resulting audio session state.
241
+ *
239
242
  * @category Audio
240
243
  */
241
244
  export function prepareAudioSessionForCall(hasVideo: boolean): void {
@@ -249,6 +252,8 @@ export function prepareAudioSessionForCall(hasVideo: boolean): void {
249
252
  * or to manually restore the audio session. This is called automatically when
250
253
  * the audio session is deactivated after a call ends.
251
254
  *
255
+ * @see {@link prepareAudioSessionForCall} — the matching setup call.
256
+ *
252
257
  * @category Audio
253
258
  */
254
259
  export function restoreAudioSession(): void {
@@ -367,6 +372,10 @@ export function addCallIntentReceivedListener(
367
372
  * );
368
373
  * ```
369
374
  *
375
+ * @see {@link addOutgoingCallStartedListener} for the event fired once the OS accepts the call.
376
+ * @see {@link reportOutgoingCallConnected} to call after the remote media stream is established.
377
+ * @see {@link endCall} to terminate the call from the app.
378
+ *
370
379
  * @category Requests
371
380
  */
372
381
  export async function startOutgoingCall(
@@ -386,6 +395,9 @@ export async function startOutgoingCall(
386
395
  * @param listener - Callback invoked when an outgoing call starts.
387
396
  * @returns A subscription that can be removed by calling `.remove()`.
388
397
  *
398
+ * @see {@link startOutgoingCall} — the request that triggers this event.
399
+ * @see {@link reportOutgoingCallConnected} — the next step in the outgoing-call flow.
400
+ *
389
401
  * @category Call Events
390
402
  */
391
403
  export function addOutgoingCallStartedListener(
@@ -420,6 +432,10 @@ export function addOutgoingCallStartedListener(
420
432
  * });
421
433
  * ```
422
434
  *
435
+ * @see {@link addIncomingCallReportedListener} — fires once the OS accepts the report.
436
+ * @see {@link addCallAnsweredListener} — fires when the user answers from the system UI.
437
+ * @see [VoIP push payload shape](https://mfairley.github.io/expo-callkit-telecom/voip-push) — the payload that drives this when called from a native push handler.
438
+ *
423
439
  * @category Reporters
424
440
  */
425
441
  export async function reportIncomingCall(
@@ -438,6 +454,9 @@ export async function reportIncomingCall(
438
454
  * @param listener - Callback invoked when an incoming call is reported.
439
455
  * @returns A subscription that can be removed by calling `.remove()`.
440
456
  *
457
+ * @see {@link reportIncomingCall} — the report that triggers this event.
458
+ * @see {@link addCallAnsweredListener} — fires when the user answers from the system UI.
459
+ *
441
460
  * @category Call Events
442
461
  */
443
462
  export function addIncomingCallReportedListener(
@@ -458,6 +477,10 @@ export function addIncomingCallReportedListener(
458
477
  *
459
478
  * @param id - The call session ID to answer.
460
479
  *
480
+ * @see {@link addCallAnsweredListener} — react to user-initiated answers from the system UI; most apps listen here rather than calling this directly.
481
+ * @see {@link fulfillIncomingCallConnected} — call after media is established.
482
+ * @see {@link failIncomingCallConnected} — call if media setup fails.
483
+ *
461
484
  * @category Requests
462
485
  */
463
486
  export async function answerCall(id: string): Promise<void> {
@@ -473,6 +496,10 @@ export async function answerCall(id: string): Promise<void> {
473
496
  * @param listener - Callback invoked when a call is answered.
474
497
  * @returns A subscription that can be removed by calling `.remove()`.
475
498
  *
499
+ * @see {@link answerCall} — the programmatic equivalent (rarely needed; usually the OS UI triggers answering).
500
+ * @see {@link fulfillIncomingCallConnected} — call after media setup completes.
501
+ * @see {@link failIncomingCallConnected} — call if media setup fails.
502
+ *
476
503
  * @category Call Events
477
504
  */
478
505
  export function addCallAnsweredListener(
@@ -493,6 +520,9 @@ export function addCallAnsweredListener(
493
520
  *
494
521
  * @param requestId - The request ID from the CallAnsweredEvent.
495
522
  *
523
+ * @see {@link addCallAnsweredListener} — the event you typically respond to before calling this.
524
+ * @see {@link failIncomingCallConnected} — call this instead if media setup fails.
525
+ *
496
526
  * @category Fulfillers
497
527
  */
498
528
  export async function fulfillIncomingCallConnected(
@@ -513,6 +543,9 @@ export async function fulfillIncomingCallConnected(
513
543
  * @param id - The call session ID.
514
544
  * @param requestId - The request ID from the CallAnsweredEvent.
515
545
  *
546
+ * @see {@link fulfillIncomingCallConnected} — call this on the success path.
547
+ * @see {@link addCallAnsweredListener} — the event you typically respond to before calling either fulfiller.
548
+ *
516
549
  * @category Fulfillers
517
550
  */
518
551
  export async function failIncomingCallConnected(
@@ -538,6 +571,9 @@ export async function failIncomingCallConnected(
538
571
  *
539
572
  * @param id - The call session ID.
540
573
  *
574
+ * @see {@link startOutgoingCall} — the call that initiated this outgoing flow.
575
+ * @see {@link addOutgoingCallStartedListener} — fires when the OS accepts the request.
576
+ *
541
577
  * @category Reporters
542
578
  */
543
579
  export async function reportOutgoingCallConnected(id: string): Promise<void> {
@@ -557,6 +593,9 @@ export async function reportOutgoingCallConnected(id: string): Promise<void> {
557
593
  *
558
594
  * @param id - The call session ID to end.
559
595
  *
596
+ * @see {@link addCallEndedListener} — confirms the call ended.
597
+ * @see {@link reportCallEnded} — call this instead when the remote party hung up (a server-side signal), so the OS records the right reason.
598
+ *
560
599
  * @category Requests
561
600
  */
562
601
  export async function endCall(id: string): Promise<void> {
@@ -572,6 +611,9 @@ export async function endCall(id: string): Promise<void> {
572
611
  * @param listener - Callback invoked when a call ends.
573
612
  * @returns A subscription that can be removed by calling `.remove()`.
574
613
  *
614
+ * @see {@link endCall} — the app-side request that fires this when the user ends from your UI.
615
+ * @see {@link reportCallEnded} — for remote-initiated ends (server tells you the other party hung up).
616
+ *
575
617
  * @category Call Events
576
618
  */
577
619
  export function addCallEndedListener(
@@ -598,6 +640,9 @@ export function addCallEndedListener(
598
640
  * await reportCallEnded(callId, 'failed');
599
641
  * ```
600
642
  *
643
+ * @see {@link endCall} — the app-initiated path (your user ended the call).
644
+ * @see {@link addReportedCallEndedListener} — confirms the OS accepted the report.
645
+ *
601
646
  * @category Reporters
602
647
  */
603
648
  export async function reportCallEnded(
@@ -616,6 +661,8 @@ export async function reportCallEnded(
616
661
  * @param listener - Callback invoked when a call end is reported.
617
662
  * @returns A subscription that can be removed by calling `.remove()`.
618
663
  *
664
+ * @see {@link reportCallEnded} — the report that triggers this event.
665
+ *
619
666
  * @category Call Events
620
667
  */
621
668
  export function addReportedCallEndedListener(
@@ -637,6 +684,8 @@ export function addReportedCallEndedListener(
637
684
  * @param id - The call session ID.
638
685
  * @param muted - Whether the microphone should be muted.
639
686
  *
687
+ * @see {@link addSetMutedActionListener} — fires when the system requests a mute change (e.g. the user pressed mute in the CallKit UI); apply the change to your media stream from there.
688
+ *
640
689
  * @category Requests
641
690
  */
642
691
  export async function setMuted(id: string, muted: boolean): Promise<void> {
@@ -652,6 +701,8 @@ export async function setMuted(id: string, muted: boolean): Promise<void> {
652
701
  * @param listener - Callback invoked when set muted action is requested.
653
702
  * @returns A subscription that can be removed by calling `.remove()`.
654
703
  *
704
+ * @see {@link setMuted} — for the app-initiated direction (programmatic mute toggle).
705
+ *
655
706
  * @category Call Events
656
707
  */
657
708
  export function addSetMutedActionListener(
@@ -672,6 +723,8 @@ export function addSetMutedActionListener(
672
723
  * @param id - The call session ID.
673
724
  * @param enabled - Whether video is enabled.
674
725
  *
726
+ * @see {@link addVideoChangedListener} — the inverse direction (system-side video state changes).
727
+ *
675
728
  * @category Reporters
676
729
  */
677
730
  export async function reportVideo(id: string, enabled: boolean): Promise<void> {
@@ -686,6 +739,8 @@ export async function reportVideo(id: string, enabled: boolean): Promise<void> {
686
739
  * @param listener - Callback invoked when video state changes.
687
740
  * @returns A subscription that can be removed by calling `.remove()`.
688
741
  *
742
+ * @see {@link reportVideo} — for reporting your app's video state changes back to the system.
743
+ *
689
744
  * @category Call Events
690
745
  */
691
746
  export function addVideoChangedListener(
@@ -707,6 +762,8 @@ export function addVideoChangedListener(
707
762
  * @param id - The call session ID.
708
763
  * @param onHold - Whether the call should be on hold.
709
764
  *
765
+ * @see {@link addSetHeldActionListener} — fires when the system requests a hold-state change.
766
+ *
710
767
  * @category Requests
711
768
  */
712
769
  export async function setHeld(id: string, onHold: boolean): Promise<void> {
@@ -722,6 +779,8 @@ export async function setHeld(id: string, onHold: boolean): Promise<void> {
722
779
  * @param listener - Callback invoked when set held action is requested.
723
780
  * @returns A subscription that can be removed by calling `.remove()`.
724
781
  *
782
+ * @see {@link setHeld} — for the app-initiated direction.
783
+ *
725
784
  * @category Call Events
726
785
  */
727
786
  export function addSetHeldActionListener(
@@ -743,6 +802,8 @@ export function addSetHeldActionListener(
743
802
  * @param id - The call session ID.
744
803
  * @param digits - The DTMF digits to play (0-9, *, #).
745
804
  *
805
+ * @see {@link addDTMFListener} — fires when the system requests DTMF tones (e.g. from the in-call keypad).
806
+ *
746
807
  * @category Requests
747
808
  */
748
809
  export async function playDTMF(id: string, digits: string): Promise<void> {
@@ -758,6 +819,8 @@ export async function playDTMF(id: string, digits: string): Promise<void> {
758
819
  * @param listener - Callback invoked when DTMF tones should be played.
759
820
  * @returns A subscription that can be removed by calling `.remove()`.
760
821
  *
822
+ * @see {@link playDTMF} — for the app-initiated direction (programmatically play tones).
823
+ *
761
824
  * @category Call Events
762
825
  */
763
826
  export function addDTMFListener(
@@ -792,6 +855,10 @@ export function addDTMFListener(
792
855
  * });
793
856
  * ```
794
857
  *
858
+ * @see {@link getVoIPPushToken} — read the current token synchronously after registration.
859
+ * @see {@link useVoIPPushToken} — React hook that reads the token and subscribes to updates.
860
+ * @see {@link addVoIPPushTokenUpdatedListener} — non-React subscription to token updates.
861
+ *
795
862
  * @category VoIP Push
796
863
  */
797
864
  export function registerVoIPPush(): void {
@@ -814,6 +881,9 @@ export function registerVoIPPush(): void {
814
881
  * }
815
882
  * ```
816
883
  *
884
+ * @see {@link registerVoIPPush} — must be called once before a token is available.
885
+ * @see {@link useVoIPPushToken} — React hook wrapper around this + the update listener.
886
+ *
817
887
  * @category VoIP Push
818
888
  */
819
889
  export function getVoIPPushToken(): VoIPPushToken | null {
@@ -847,6 +917,9 @@ export function getVoIPPushToken(): VoIPPushToken | null {
847
917
  * });
848
918
  * ```
849
919
  *
920
+ * @see {@link useVoIPPushToken} — React hook that uses this internally; prefer it in components.
921
+ * @see {@link registerVoIPPush} — must be called once before any token updates fire.
922
+ *
850
923
  * @category VoIP Push
851
924
  */
852
925
  export function addVoIPPushTokenUpdatedListener(
@@ -14,6 +14,10 @@ import type { PushTokenType, VoIPPushToken } from "../Calls.types";
14
14
  *
15
15
  * @returns The current token, or `null` if not yet available.
16
16
  *
17
+ * @see {@link registerVoIPPush} — must be called once before any token will be available.
18
+ * @see {@link getVoIPPushToken} — non-hook accessor for the same token.
19
+ * @see {@link addVoIPPushTokenUpdatedListener} — the underlying subscription.
20
+ *
17
21
  * @category Hooks
18
22
  */
19
23
  export function useVoIPPushToken(): VoIPPushToken | null {