react-native-sinch-calling 0.9.0 → 0.11.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.
package/CHANGELOG.md CHANGED
@@ -6,7 +6,9 @@ All notable changes to this project are documented in this file.
6
6
 
7
7
  ### Added
8
8
 
9
- - `configureCustomCancelCallPush`'s optional 3rd argument, `reasonField` (Android only) — names the field on a custom cancel push carrying *why* the call was cancelled. When it's `"FORWARDED"`, Android now leaves behind a distinct "call forwarded" notice once the ringing notification is torn down; every other reason gets a plain "missed call" notice instead of the phone just silently going quiet.
9
+ - `callPhoneNumberWithHeaders(phoneNumber, callerId, headers)`: a PSTN call that also sends custom call headers (e.g. `{ 'x-cli': callerId }`), which iOS passes to the Sinch SDK. This lets an iOS app choose the caller ID through a header your backend reads (for example from the call's `callheaders` in the Sinch ICE callback), the way the web SDK's `callPhoneNumber(number, headers)` does. Android keeps using `callerId` (its SDK has no per-call headers). `callPhoneNumber` is unchanged, so existing apps are not affected.
10
+
11
+ - `configureCustomCancelCallPush`'s optional 3rd argument, `reasonField` — names the field on a custom cancel push carrying *why* the call was cancelled. When it's `"FORWARDED"`, both platforms now leave behind a distinct "call forwarded" notice once the ringing call UI is torn down (a heads-up notification on Android, a local notification via a new `SinchMissedCallNotifier` on iOS); every other reason gets a plain "missed call" notice instead of the phone just silently going quiet.
10
12
  - The Android incoming-call notification channel now uses the device's actual ringtone (`RingtoneManager.TYPE_RINGTONE`) instead of the default notification sound.
11
13
  - Android: a foreground service (`phoneCall`/`microphone` types) now starts automatically the moment a call goes active and stops when it ends, so the app keeps microphone access once backgrounded during a call — required by Android 14's background mic-capture restrictions. Nothing to call from JS; the manifest permissions it needs merge in automatically.
12
14
  - `isFullScreenIntentPermissionGranted()` / `requestFullScreenIntentPermission()` (Android only, no-ops elsewhere) — Android 14+ can silently auto-revoke `USE_FULL_SCREEN_INTENT` for apps it doesn't recognize as a "calling" app, which breaks the lock-screen ring with no visible error. Lets a consumer app check for this and prompt the user to re-grant it.
package/README.md CHANGED
@@ -195,11 +195,12 @@ SinchCalling.onCallUIDeclined(({ callId }) => {
195
195
  // to say which call they're about) would otherwise make every cancel push
196
196
  // look like a new incoming call. Configure the field/value your backend
197
197
  // uses to mark a cancel, e.g. `{ type: "call_cancelled", callId, reason }`.
198
- // The optional 3rd arg (Android only) names the field carrying *why* it was
199
- // cancelled — when it's `"FORWARDED"`, Android leaves behind a distinct
198
+ // The optional 3rd arg names the field carrying *why* it was cancelled —
199
+ // when it's `"FORWARDED"`, both platforms leave behind a distinct
200
200
  // "call forwarded" notice instead of a plain "missed call" once the ringing
201
- // notification is torn down, so the rep isn't left wondering why the phone
202
- // stopped ringing.
201
+ // call UI is torn down, so the rep isn't left wondering why the phone
202
+ // stopped ringing (a heads-up notification on Android, a local notification
203
+ // on iOS).
203
204
  SinchCalling.configureCustomCancelCallPush('type', 'call_cancelled', 'reason');
204
205
 
205
206
  // Fires once a cancel push has ended the system call UI natively — clean up
@@ -307,7 +308,7 @@ SinchCalling.onClientStartFailed(({ code }) => {
307
308
  | `enablePushNotifications(useProductionAps)` | iOS | No-op on Android |
308
309
  | `relayRemotePushNotification(payload)` | Android | No-op on iOS |
309
310
  | `configureCustomIncomingCallPush(idField, displayField)` | both | Opt-in — see [Custom incoming-call flows](#custom-incoming-call-flows) |
310
- | `configureCustomCancelCallPush(typeField, cancelValue, reasonField?)` | both | Opt-in — distinguishes a cancel/end push from a new-call push, see [Custom incoming-call flows](#custom-incoming-call-flows). `reasonField` is Android-only, drives the missed/forwarded notice |
311
+ | `configureCustomCancelCallPush(typeField, cancelValue, reasonField?)` | both | Opt-in — distinguishes a cancel/end push from a new-call push, see [Custom incoming-call flows](#custom-incoming-call-flows). `reasonField` drives a missed/forwarded notice on both platforms |
311
312
  | `reportIncomingCallUI(callId, displayName)` | both | Shows a call UI for any reason you decide to |
312
313
  | `resolveCallUIToConference(callId, conferenceId, callerId)` → `callId` | both | Turns a shown call UI into a real call |
313
314
  | `dismissCallUI(callId)` | both | Cleans up a call UI that couldn't be resolved |
@@ -25,10 +25,5 @@ Pod::Spec.new do |s|
25
25
 
26
26
  s.dependency "SinchRTC"
27
27
 
28
- s.pod_target_xcconfig = {
29
- "CLANG_ENABLE_MODULES" => "YES",
30
- "OTHER_CPLUSPLUSFLAGS" => "$(inherited) -fcxx-modules"
31
- }
32
-
33
28
  install_modules_dependencies(s)
34
29
  end
@@ -117,6 +117,15 @@ class SinchCallingModule(reactContext: ReactApplicationContext) :
117
117
  return callManager.callPhoneNumber(phoneNumber, callerId)
118
118
  }
119
119
 
120
+ // The Android SDK has no per-call headers: the caller ID goes through `callerId`
121
+ override fun callPhoneNumberWithHeaders(
122
+ phoneNumber: String,
123
+ callerId: String,
124
+ headers: ReadableMap
125
+ ): String {
126
+ return callManager.callPhoneNumber(phoneNumber, callerId)
127
+ }
128
+
120
129
  override fun callConference(conferenceId: String, callerId: String): String {
121
130
  return callManager.callConference(conferenceId, callerId)
122
131
  }
@@ -107,6 +107,15 @@ public final class SinchCallManager: NSObject {
107
107
  return call.callId
108
108
  }
109
109
 
110
+ // Headers are NSString key/value pairs the Sinch SDK forwards with the call
111
+ @objc public func callPhoneNumber(_ phoneNumber: String, headers: [String: String]) -> String {
112
+ guard let call = client?.call().callPhoneNumber(phoneNumber, headers: headers) else {
113
+ return ""
114
+ }
115
+ track(call)
116
+ return call.callId
117
+ }
118
+
110
119
  @objc public func callConference(_ conferenceId: String) -> String {
111
120
  guard let call = client?.call().callConference(withId: conferenceId) else {
112
121
  return ""
@@ -0,0 +1,32 @@
1
+ import Foundation
2
+ import UserNotifications
3
+
4
+ // A still-ringing call was called off by a custom cancel push (see
5
+ // `SinchPushManager`) — CallKit's system call screen has already been
6
+ // dismissed by the time this runs, silently, with nothing explaining why the
7
+ // phone stopped ringing (unlike Android's ringing notification, which leaves
8
+ // a distinct notice behind — see `SinchIncomingCallNotification` on that
9
+ // platform). Posts a plain local notification instead: "Call forwarded" when
10
+ // `reason == "FORWARDED"`, "Missed call" for everything else (answered
11
+ // elsewhere, declined, hung up, ...).
12
+ //
13
+ // Relies on notification authorization the host app already obtained for
14
+ // its own remote-push setup — a library has no business prompting for
15
+ // permissions on its own, and `UNUserNotificationCenter.add` is a silent
16
+ // no-op if authorization was never granted.
17
+ @objc(SinchMissedCallNotifier)
18
+ public final class SinchMissedCallNotifier: NSObject {
19
+ @objc public static func postCancelledNotice(callId: String, reason: String?, displayName: String?) {
20
+ let content = UNMutableNotificationContent()
21
+ content.title = reason == "FORWARDED" ? "Call forwarded" : "Missed call"
22
+ content.body = (displayName?.isEmpty == false) ? displayName! : "Unknown"
23
+ content.sound = .default
24
+
25
+ let request = UNNotificationRequest(
26
+ identifier: "sinch-cancelled-\(callId)",
27
+ content: content,
28
+ trigger: nil
29
+ )
30
+ UNUserNotificationCenter.current().add(request, withCompletionHandler: nil)
31
+ }
32
+ }
@@ -40,6 +40,11 @@ public final class SinchPushManager: NSObject {
40
40
  private var customDisplayField: String?
41
41
  private var customCancelTypeField: String?
42
42
  private var customCancelValue: String?
43
+ private var customCancelReasonField: String?
44
+ // The reported-call display name only carries the caller name for as long
45
+ // as it's ringing — captured here so a later cancel push can put a name to
46
+ // the missed/forwarded notice instead of just "Unknown".
47
+ private var displayNames: [String: String] = [:]
43
48
 
44
49
  @objc public init(callManager: SinchCallManager, callKitManager: SinchCallKitManager) {
45
50
  self.callManager = callManager
@@ -66,10 +71,17 @@ public final class SinchPushManager: NSObject {
66
71
  // backend reuses the same `idField` but sets `type: "call_cancelled"`
67
72
  // instead of `"incoming_call"`. Checked before the incoming-call match in
68
73
  // `didReceiveIncomingPushWith`, so a push satisfying both is treated as a
69
- // cancel.
70
- @objc public func configureCustomCancelCallPush(typeField: String, cancelValue: String) {
74
+ // cancel. `reasonField` is optional — if the payload carries one (e.g.
75
+ // "FORWARDED" vs anything else), it drives the missed/forwarded notice
76
+ // posted via `SinchMissedCallNotifier`.
77
+ @objc public func configureCustomCancelCallPush(
78
+ typeField: String,
79
+ cancelValue: String,
80
+ reasonField: String? = nil
81
+ ) {
71
82
  customCancelTypeField = typeField
72
83
  customCancelValue = cancelValue
84
+ customCancelReasonField = reasonField
73
85
  }
74
86
  }
75
87
 
@@ -105,9 +117,13 @@ extension SinchPushManager: PKPushRegistryDelegate {
105
117
  typeValue == cancelValue
106
118
  {
107
119
  callKitManager?.reportCallEnded(callId)
120
+ let reason = customCancelReasonField.flatMap { dict[$0] as? String }
121
+ let displayName = displayNames.removeValue(forKey: callId)
122
+ SinchMissedCallNotifier.postCancelledNotice(callId: callId, reason: reason, displayName: displayName)
108
123
  delegate?.sinchPushManagerDidDetectCustomCancelCall(callId)
109
124
  } else {
110
125
  let displayName = customDisplayField.flatMap { dict[$0] as? String } ?? ""
126
+ displayNames[callId] = displayName
111
127
  callKitManager?.reportExternalIncomingCall(callId, displayName: displayName)
112
128
  delegate?.sinchPushManagerDidDetectCustomIncomingCall(callId, displayName: displayName)
113
129
  }
@@ -1,4 +1,12 @@
1
1
  #import <AVFoundation/AVFoundation.h>
2
+ // The Swift-generated header below refers to these frameworks' types. Import
3
+ // them as plain headers so it compiles without clang C++ modules
4
+ // (`-fcxx-modules`), which React Native's prebuilt React framework (0.87+)
5
+ // does not support.
6
+ #import <CallKit/CallKit.h>
7
+ #import <PushKit/PushKit.h>
8
+ #import <UserNotifications/UserNotifications.h>
9
+ #import <SinchRTC/SinchRTC.h>
2
10
 
3
11
  #import "SinchCalling.h"
4
12
 
@@ -48,7 +56,7 @@ static void SinchCallingEnsureSharedManagers(void)
48
56
  #endif
49
57
  [sSharedPushManager enableWithUseProductionAps:useProductionAps];
50
58
  [sSharedPushManager configureCustomIncomingCallPushWithIdField:@"callId" displayField:@"callerNumber"];
51
- [sSharedPushManager configureCustomCancelCallPushWithTypeField:@"type" cancelValue:@"call_cancelled"];
59
+ [sSharedPushManager configureCustomCancelCallPushWithTypeField:@"type" cancelValue:@"call_cancelled" reasonField:@"reason"];
52
60
  }
53
61
 
54
62
  - (instancetype)init
@@ -100,6 +108,13 @@ static void SinchCallingEnsureSharedManagers(void)
100
108
  return [_callManager callPhoneNumber:phoneNumber];
101
109
  }
102
110
 
111
+ - (NSString *)callPhoneNumberWithHeaders:(NSString *)phoneNumber
112
+ callerId:(NSString *)callerId
113
+ headers:(NSDictionary *)headers
114
+ {
115
+ return [_callManager callPhoneNumber:phoneNumber headers:headers];
116
+ }
117
+
103
118
  - (NSString *)callConference:(NSString *)conferenceId callerId:(NSString *)callerId
104
119
  {
105
120
  return [_callManager callConference:conferenceId];
@@ -117,10 +132,9 @@ static void SinchCallingEnsureSharedManagers(void)
117
132
 
118
133
  - (void)configureCustomCancelCallPush:(NSString *)typeField cancelValue:(NSString *)cancelValue reasonField:(NSString *)reasonField
119
134
  {
120
- // `reasonField` drives Android's missed-vs-forwarded notice (see that
121
- // platform's SinchTelecomManager) — iOS has no equivalent yet, since a
122
- // cancelled call there just ends the already-visible CallKit screen.
123
- [_pushManager configureCustomCancelCallPushWithTypeField:typeField cancelValue:cancelValue];
135
+ // `reasonField` drives a missed-vs-forwarded local notification posted via
136
+ // SinchMissedCallNotifier once the already-visible CallKit screen ends.
137
+ [_pushManager configureCustomCancelCallPushWithTypeField:typeField cancelValue:cancelValue reasonField:reasonField];
124
138
  }
125
139
 
126
140
  - (void)reportIncomingCallUI:(NSString *)callId displayName:(NSString *)displayName
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSinchCalling.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;AA4MpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSinchCalling.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;AAsNpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,cAAc,CAAC","ignoreList":[]}
@@ -49,6 +49,20 @@ class SinchCalling {
49
49
  return NativeSinchCalling.callPhoneNumber(phoneNumber, callerId);
50
50
  }
51
51
 
52
+ /**
53
+ * PSTN call that also sends custom call headers, e.g. `{ 'x-cli': callerId }`
54
+ * so your backend can pick the caller ID the way the Sinch web SDK's
55
+ * `callPhoneNumber(number, headers)` allows.
56
+ *
57
+ * iOS: `headers` go to the Sinch SDK and `callerId` is not used by it.
58
+ * Android: the SDK has no per-call headers, so `callerId` is used and
59
+ * `headers` is ignored. Pass both to behave the same on both platforms.
60
+ * `callPhoneNumber` is unchanged.
61
+ */
62
+ callPhoneNumberWithHeaders(phoneNumber, callerId, headers) {
63
+ return NativeSinchCalling.callPhoneNumberWithHeaders(phoneNumber, callerId, headers);
64
+ }
65
+
52
66
  /**
53
67
  * Joins a Sinch conference room by id — e.g. to answer a call your
54
68
  * backend parked and bridged into a conference (see `reportIncomingCallUI`
@@ -131,12 +145,11 @@ class SinchCalling {
131
145
  * call UI instead of being reported as a new incoming call. Has no effect
132
146
  * until `configureCustomIncomingCallPush` has also been called.
133
147
  *
134
- * `reasonField` (Android only) — if your payload also carries a reason
135
- * (e.g. `{ ..., reason: 'FORWARDED' }`), naming that field here makes
136
- * Android show a distinct "call forwarded" vs "missed call" heads-up
137
- * notification instead of just silently dismissing the ringing one.
138
- * iOS ignores this; its cancel just ends the CallKit screen already
139
- * showing, with no equivalent notice.
148
+ * `reasonField` — if your payload also carries a reason (e.g.
149
+ * `{ ..., reason: 'FORWARDED' }`), naming that field here makes both
150
+ * platforms show a distinct "call forwarded" vs "missed call" notice
151
+ * (a heads-up notification on Android, a local notification on iOS)
152
+ * instead of just silently dismissing the ringing call UI.
140
153
  */
141
154
  configureCustomCancelCallPush(typeField, cancelValue, reasonField) {
142
155
  NativeSinchCalling.configureCustomCancelCallPush(typeField, cancelValue, reasonField);
@@ -1 +1 @@
1
- {"version":3,"names":["NativeSinchCalling","SinchCalling","credentialsProviderSubscription","configure","config","appKey","environmentHost","userId","start","stop","setRegistrationCredentialsProvider","provider","remove","onRegistrationCredentialsRequired","jwt","provideRegistrationCredentials","error","failRegistration","Error","message","String","onClientStarted","listener","onClientStartFailed","callUser","callPhoneNumber","phoneNumber","callerId","callConference","conferenceId","answerCall","callId","hangupCall","setMuted","muted","setSpeakerEnabled","enabled","sendDTMF","key","onIncomingCall","onCallProgressing","onCallEstablished","onCallEnded","registerFcmPush","senderId","token","enablePushNotifications","useProductionAps","relayRemotePushNotification","payload","configureCustomIncomingCallPush","idField","displayField","configureCustomCancelCallPush","typeField","cancelValue","reasonField","reportIncomingCallUI","displayName","onPushTokenRegistered","onPushTokenRegistrationFailed","resolveCallUIToConference","dismissCallUI","updateIncomingCallDisplayName","configureIncomingCallNotification","isFullScreenIntentPermissionGranted","requestFullScreenIntentPermission","onVoipPushTokenUpdated","onIncomingCallUIShown","onCallUIAnswered","onCallUIDeclined","onIncomingCallUICancelled"],"sourceRoot":"../../src","sources":["SinchCalling.ts"],"mappings":";;AACA,OAAOA,kBAAkB,MAUlB,yBAAsB;AA2B7B,MAAMC,YAAY,CAAC;EACTC,+BAA+B,GAA6B,IAAI;EAExEC,SAASA,CAACC,MAAyB,EAAQ;IACzCJ,kBAAkB,CAACG,SAAS,CAC1BC,MAAM,CAACC,MAAM,EACbD,MAAM,CAACE,eAAe,EACtBF,MAAM,CAACG,MACT,CAAC;EACH;EAEAC,KAAKA,CAAA,EAAS;IACZR,kBAAkB,CAACQ,KAAK,CAAC,CAAC;EAC5B;EAEAC,IAAIA,CAAA,EAAS;IACXT,kBAAkB,CAACS,IAAI,CAAC,CAAC;EAC3B;;EAEA;AACF;AACA;AACA;AACA;EACEC,kCAAkCA,CAChCC,QAAyC,EACnC;IACN,IAAI,CAACT,+BAA+B,EAAEU,MAAM,CAAC,CAAC;IAC9C,IAAI,CAACV,+BAA+B,GAClCF,kBAAkB,CAACa,iCAAiC,CAAC,YAAY;MAC/D,IAAI;QACF,MAAMC,GAAG,GAAG,MAAMH,QAAQ,CAAC,CAA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;IACnB,OAAOtB,kBAAkB,CAACmE,sBAAsB,CAAC7C,QAAQ,CAAC;EAC5D;;EAEA;AACF;AACA;AACA;AACA;EACE8C,qBAAqBA,CACnB9C,QAA8C,EAC3B;IACnB,OAAOtB,kBAAkB,CAACoE,qBAAqB,CAAC9C,QAAQ,CAAC;EAC3D;;EAEA;EACA+C,gBAAgBA,CACd/C,QAA8C,EAC3B;IACnB,OAAOtB,kBAAkB,CAACqE,gBAAgB,CAAC/C,QAAQ,CAAC;EACtD;;EAEA;EACAgD,gBAAgBA,CACdhD,QAA8C,EAC3B;IACnB,OAAOtB,kBAAkB,CAACsE,gBAAgB,CAAChD,QAAQ,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEiD,yBAAyBA,CACvBjD,QAAuD,EACpC;IACnB,OAAOtB,kBAAkB,CAACuE,yBAAyB,CAACjD,QAAQ,CAAC;EAC/D;AACF;AAEA,eAAe,IAAIrB,YAAY,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NativeSinchCalling","SinchCalling","credentialsProviderSubscription","configure","config","appKey","environmentHost","userId","start","stop","setRegistrationCredentialsProvider","provider","remove","onRegistrationCredentialsRequired","jwt","provideRegistrationCredentials","error","failRegistration","Error","message","String","onClientStarted","listener","onClientStartFailed","callUser","callPhoneNumber","phoneNumber","callerId","callPhoneNumberWithHeaders","headers","callConference","conferenceId","answerCall","callId","hangupCall","setMuted","muted","setSpeakerEnabled","enabled","sendDTMF","key","onIncomingCall","onCallProgressing","onCallEstablished","onCallEnded","registerFcmPush","senderId","token","enablePushNotifications","useProductionAps","relayRemotePushNotification","payload","configureCustomIncomingCallPush","idField","displayField","configureCustomCancelCallPush","typeField","cancelValue","reasonField","reportIncomingCallUI","displayName","onPushTokenRegistered","onPushTokenRegistrationFailed","resolveCallUIToConference","dismissCallUI","updateIncomingCallDisplayName","configureIncomingCallNotification","isFullScreenIntentPermissionGranted","requestFullScreenIntentPermission","onVoipPushTokenUpdated","onIncomingCallUIShown","onCallUIAnswered","onCallUIDeclined","onIncomingCallUICancelled"],"sourceRoot":"../../src","sources":["SinchCalling.ts"],"mappings":";;AACA,OAAOA,kBAAkB,MAUlB,yBAAsB;AA2B7B,MAAMC,YAAY,CAAC;EACTC,+BAA+B,GAA6B,IAAI;EAExEC,SAASA,CAACC,MAAyB,EAAQ;IACzCJ,kBAAkB,CAACG,SAAS,CAC1BC,MAAM,CAACC,MAAM,EACbD,MAAM,CAACE,eAAe,EACtBF,MAAM,CAACG,MACT,CAAC;EACH;EAEAC,KAAKA,CAAA,EAAS;IACZR,kBAAkB,CAACQ,KAAK,CAAC,CAAC;EAC5B;EAEAC,IAAIA,CAAA,EAAS;IACXT,kBAAkB,CAACS,IAAI,CAAC,CAAC;EAC3B;;EAEA;AACF;AACA;AACA;AACA;EACEC,kCAAkCA,CAChCC,QAAyC,EACnC;IACN,IAAI,CAACT,+BAA+B,EAAEU,MAAM,CAAC,CAAC;IAC9C,IAAI,CAACV,+BAA+B,GAClCF,kBAAkB,CAACa,iCAAiC,CAAC,YAAY;MAC/D,IAAI;QACF,MAAMC,GAAG,GAAG,MAAMH,QAAQ,CAAC,CAAC;QAC5BX,kBAAkB,CAACe,8BAA8B,CAACD,GAAG,CAAC;MACxD,CAAC,CAAC,OAAOE,KAAK,EAAE;QACdhB,kBAAkB,CAACiB,gBAAgB,CACjCD,KAAK,YAAYE,KAAK,GAAGF,KAAK,CAACG,OAAO,GAAGC,MAAM,CAACJ,KAAK,CACvD,CAAC;MACH;IACF,CAAC,CAAC;EACN;EAEAK,eAAeA,CAACC,QAAoB,EAAqB;IACvD,OAAOtB,kBAAkB,CAACqB,eAAe,CAACC,QAAQ,CAAC;EACrD;EAEAC,mBAAmBA,CACjBD,QAAiD,EAC9B;IACnB,OAAOtB,kBAAkB,CAACuB,mBAAmB,CAACD,QAAQ,CAAC;EACzD;EAEAE,QAAQA,CAACjB,MAAc,EAAU;IAC/B,OAAOP,kBAAkB,CAACwB,QAAQ,CAACjB,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;EAEA;EACAkD,gBAAgBA,CACdlD,QAA8C,EAC3B;IACnB,OAAOtB,kBAAkB,CAACwE,gBAAgB,CAAClD,QAAQ,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEmD,yBAAyBA,CACvBnD,QAAuD,EACpC;IACnB,OAAOtB,kBAAkB,CAACyE,yBAAyB,CAACnD,QAAQ,CAAC;EAC/D;AACF;AAEA,eAAe,IAAIrB,YAAY,CAAC,CAAC","ignoreList":[]}
@@ -39,6 +39,7 @@ export interface Spec extends TurboModule {
39
39
  failRegistration(message: string): void;
40
40
  callUser(userId: string): string;
41
41
  callPhoneNumber(phoneNumber: string, callerId: string): string;
42
+ callPhoneNumberWithHeaders(phoneNumber: string, callerId: string, headers: Object): string;
42
43
  callConference(conferenceId: string, callerId: string): string;
43
44
  answerCall(callId: string): void;
44
45
  hangupCall(callId: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeSinchCalling.d.ts","sourceRoot":"","sources":["../../../src/NativeSinchCalling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAA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,CAAC,4BAA4B,CAAC,CAAC;IAMnF,gBAAgB,EAAE,YAAY,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;IACjE,gBAAgB,EAAE,YAAY,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;CAClE;;AAED,wBAAsE"}
@@ -42,6 +42,17 @@ declare class SinchCalling {
42
42
  * voice number instead).
43
43
  */
44
44
  callPhoneNumber(phoneNumber: string, callerId: string): string;
45
+ /**
46
+ * PSTN call that also sends custom call headers, e.g. `{ 'x-cli': callerId }`
47
+ * so your backend can pick the caller ID the way the Sinch web SDK's
48
+ * `callPhoneNumber(number, headers)` allows.
49
+ *
50
+ * iOS: `headers` go to the Sinch SDK and `callerId` is not used by it.
51
+ * Android: the SDK has no per-call headers, so `callerId` is used and
52
+ * `headers` is ignored. Pass both to behave the same on both platforms.
53
+ * `callPhoneNumber` is unchanged.
54
+ */
55
+ callPhoneNumberWithHeaders(phoneNumber: string, callerId: string, headers: Record<string, string>): string;
45
56
  /**
46
57
  * Joins a Sinch conference room by id — e.g. to answer a call your
47
58
  * backend parked and bridged into a conference (see `reportIncomingCallUI`
@@ -90,12 +101,11 @@ declare class SinchCalling {
90
101
  * call UI instead of being reported as a new incoming call. Has no effect
91
102
  * until `configureCustomIncomingCallPush` has also been called.
92
103
  *
93
- * `reasonField` (Android only) — if your payload also carries a reason
94
- * (e.g. `{ ..., reason: 'FORWARDED' }`), naming that field here makes
95
- * Android show a distinct "call forwarded" vs "missed call" heads-up
96
- * notification instead of just silently dismissing the ringing one.
97
- * iOS ignores this; its cancel just ends the CallKit screen already
98
- * showing, with no equivalent notice.
104
+ * `reasonField` — if your payload also carries a reason (e.g.
105
+ * `{ ..., reason: 'FORWARDED' }`), naming that field here makes both
106
+ * platforms show a distinct "call forwarded" vs "missed call" notice
107
+ * (a heads-up notification on Android, a local notification on iOS)
108
+ * instead of just silently dismissing the ringing call UI.
99
109
  */
100
110
  configureCustomCancelCallPush(typeField: string, cancelValue: string, reasonField?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E,4BAA4B,KAAK,IAAI,GACtD,iBAAiB;CAGrB;;AAED,wBAAkC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-sinch-calling",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "React Native TurboModule wrapper for Sinch Voice Calling SDK (Android & iOS)",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -54,6 +54,15 @@ export interface Spec extends TurboModule {
54
54
  // (Android only — the iOS SDK derives it from the application's
55
55
  // provisioned voice number and ignores this argument).
56
56
  callPhoneNumber(phoneNumber: string, callerId: string): string;
57
+ // PSTN call that also sends custom call headers (e.g. `{ 'x-cli': '+614...' }`,
58
+ // which your backend can read from the ICE callback to pick the caller ID).
59
+ // iOS passes them to the Sinch SDK; Android keeps using `callerId` (the
60
+ // Android SDK has no per-call header API), so pass both.
61
+ callPhoneNumberWithHeaders(
62
+ phoneNumber: string,
63
+ callerId: string,
64
+ headers: Object
65
+ ): string;
57
66
  // Joins a Sinch conference room by id (e.g. a backend-bridged PSTN leg).
58
67
  // `callerId` is Android-only, same caveat as `callPhoneNumber`.
59
68
  callConference(conferenceId: string, callerId: string): string;
@@ -104,10 +113,11 @@ export interface Spec extends TurboModule {
104
113
  // reason (e.g. `{ type: "call_cancelled", callId, reason: "FORWARDED" }`),
105
114
  // naming that field here lets a "forwarded" cancel be told apart from any
106
115
  // other reason (declined, hung up, answered elsewhere, ...), which
107
- // `onIncomingCallUICancelled` doesn't otherwise distinguish. Android only,
108
- // for now — the missed/forwarded notice this drives is a heads-up
109
- // notification shown natively when the app is backgrounded/killed; iOS's
110
- // system call screen has no equivalent yet.
116
+ // `onIncomingCallUICancelled` doesn't otherwise distinguish. Drives a
117
+ // missed/forwarded notice on both platforms once the ringing call UI ends:
118
+ // a heads-up notification on Android, a local notification on iOS (since
119
+ // CallKit's system call screen just disappears with no explanation
120
+ // otherwise).
111
121
  configureCustomCancelCallPush(
112
122
  typeField: string,
113
123
  cancelValue: string,
@@ -101,6 +101,28 @@ class SinchCalling {
101
101
  return NativeSinchCalling.callPhoneNumber(phoneNumber, callerId);
102
102
  }
103
103
 
104
+ /**
105
+ * PSTN call that also sends custom call headers, e.g. `{ 'x-cli': callerId }`
106
+ * so your backend can pick the caller ID the way the Sinch web SDK's
107
+ * `callPhoneNumber(number, headers)` allows.
108
+ *
109
+ * iOS: `headers` go to the Sinch SDK and `callerId` is not used by it.
110
+ * Android: the SDK has no per-call headers, so `callerId` is used and
111
+ * `headers` is ignored. Pass both to behave the same on both platforms.
112
+ * `callPhoneNumber` is unchanged.
113
+ */
114
+ callPhoneNumberWithHeaders(
115
+ phoneNumber: string,
116
+ callerId: string,
117
+ headers: Record<string, string>
118
+ ): string {
119
+ return NativeSinchCalling.callPhoneNumberWithHeaders(
120
+ phoneNumber,
121
+ callerId,
122
+ headers
123
+ );
124
+ }
125
+
104
126
  /**
105
127
  * Joins a Sinch conference room by id — e.g. to answer a call your
106
128
  * backend parked and bridged into a conference (see `reportIncomingCallUI`
@@ -193,12 +215,11 @@ class SinchCalling {
193
215
  * call UI instead of being reported as a new incoming call. Has no effect
194
216
  * until `configureCustomIncomingCallPush` has also been called.
195
217
  *
196
- * `reasonField` (Android only) — if your payload also carries a reason
197
- * (e.g. `{ ..., reason: 'FORWARDED' }`), naming that field here makes
198
- * Android show a distinct "call forwarded" vs "missed call" heads-up
199
- * notification instead of just silently dismissing the ringing one.
200
- * iOS ignores this; its cancel just ends the CallKit screen already
201
- * showing, with no equivalent notice.
218
+ * `reasonField` — if your payload also carries a reason (e.g.
219
+ * `{ ..., reason: 'FORWARDED' }`), naming that field here makes both
220
+ * platforms show a distinct "call forwarded" vs "missed call" notice
221
+ * (a heads-up notification on Android, a local notification on iOS)
222
+ * instead of just silently dismissing the ringing call UI.
202
223
  */
203
224
  configureCustomCancelCallPush(
204
225
  typeField: string,