react-native-sinch-calling 0.8.0 → 0.10.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
@@ -4,6 +4,13 @@ All notable changes to this project are documented in this file.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ### Added
8
+
9
+ - `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
+ - The Android incoming-call notification channel now uses the device's actual ringtone (`RingtoneManager.TYPE_RINGTONE`) instead of the default notification sound.
11
+ - 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
+ - `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.
13
+
7
14
  ### Fixed
8
15
 
9
16
  - Making `SinchCalling.h` public (0.6.1) fixed the missing-symbol error but broke the build a different way: that header pulls in the Codegen-generated `SinchCallingSpec.h`, which requires Objective-C++ — fine for the `.mm` files that already imported it internally, but Clang errors (`Could not build Objective-C module 'SinchCalling'`, `'utility' file not found`, `This file must be compiled as Obj-C++`) trying to build it as this pod's *public* Swift-facing module interface. Moved the one thing that actually needs to be public — `eagerlyRegisterForVoipPush` — onto a new, separate `SinchCallingBootstrap` class with its own header that has no dependency on `SinchCallingSpec.h` at all. `SinchCalling.h` goes back to private.
package/README.md CHANGED
@@ -194,8 +194,14 @@ SinchCalling.onCallUIDeclined(({ callId }) => {
194
194
  // — reusing the same `idField` for both (a natural design, since both need
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
- // uses to mark a cancel, e.g. `{ type: "call_cancelled", callId, reason }`:
198
- SinchCalling.configureCustomCancelCallPush('type', 'call_cancelled');
197
+ // uses to mark a cancel, e.g. `{ type: "call_cancelled", callId, reason }`.
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
+ // "call forwarded" notice instead of a plain "missed call" once the 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).
204
+ SinchCalling.configureCustomCancelCallPush('type', 'call_cancelled', 'reason');
199
205
 
200
206
  // Fires once a cancel push has ended the system call UI natively — clean up
201
207
  // any app-side state keyed by `callId` (a pending caller-ID lookup, etc.).
@@ -252,6 +258,28 @@ SinchCalling.configureIncomingCallNotification({ enabled: false });
252
258
 
253
259
  Tapping the notification body (or its full-screen intent when the device is locked) opens your app's own launcher activity with a `callId` extra — same as any other push notification tap — so your existing navigation/deep-link handling decides what screen to show. Tapping Answer/Decline, by contrast, is handled entirely at the native Telecom layer (via `SinchTelecomManager`, same as a Bluetooth headset button would be) and works even before your JS has started.
254
260
 
261
+ ### Android: keeping the call's microphone alive in the background
262
+
263
+ Android 14 (API 34) restricts a backgrounded app from continuing to capture microphone audio unless it's running a foreground service declared with the `phoneCall`/`microphone` types. This library starts one automatically the moment a call goes active and stops it the moment the call ends — nothing to call from JS. It shows its own low-priority "Call in progress" notification for as long as it runs, using the same icon/config as `configureIncomingCallNotification`. The manifest permissions it needs (`FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_PHONE_CALL`, `FOREGROUND_SERVICE_MICROPHONE`) are declared in the library's own manifest and merge into your app automatically.
264
+
265
+ ### Android: the full-screen-intent permission can be silently revoked
266
+
267
+ `USE_FULL_SCREEN_INTENT` (what makes the incoming-call notification wake the lock screen) is auto-revoked by Android 14+ for apps the OS doesn't recognize as a "calling" app, as of a January 2025 Play policy change — silently, with no callback to your app. The notification still posts when this happens, it just never launches the full-screen intent, so a call arriving while the device is locked shows nothing until the user unlocks and pulls down the shade — a confusing "calls don't ring" report with no exception to point at.
268
+
269
+ Check for this (e.g. once at app launch, or whenever your app returns to the foreground) and prompt the user to re-grant it if needed:
270
+
271
+ ```ts
272
+ import { SinchCalling } from 'react-native-sinch-calling';
273
+
274
+ if (!SinchCalling.isFullScreenIntentPermissionGranted()) {
275
+ // Show your own explanation first — this opens a system settings screen,
276
+ // which is disruptive without context.
277
+ SinchCalling.requestFullScreenIntentPermission();
278
+ }
279
+ ```
280
+
281
+ Both are no-ops that return `true`/do nothing on iOS and on Android below API 34, where the permission is granted at install time and can't be revoked this way.
282
+
255
283
  ### Retrying after a failure
256
284
 
257
285
  The SDK doesn't expose a distinct "reconnecting" callback — only `onClientStartFailed` (client-level) and `onCallEnded` with `endCause: 'error'` (call-level). Both events include a `code` (native error code) you can use to decide whether to retry:
@@ -280,12 +308,14 @@ SinchCalling.onClientStartFailed(({ code }) => {
280
308
  | `enablePushNotifications(useProductionAps)` | iOS | No-op on Android |
281
309
  | `relayRemotePushNotification(payload)` | Android | No-op on iOS |
282
310
  | `configureCustomIncomingCallPush(idField, displayField)` | both | Opt-in — see [Custom incoming-call flows](#custom-incoming-call-flows) |
283
- | `configureCustomCancelCallPush(typeField, cancelValue)` | both | Opt-in — distinguishes a cancel/end push from a new-call push, see [Custom incoming-call flows](#custom-incoming-call-flows) |
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 |
284
312
  | `reportIncomingCallUI(callId, displayName)` | both | Shows a call UI for any reason you decide to |
285
313
  | `resolveCallUIToConference(callId, conferenceId, callerId)` → `callId` | both | Turns a shown call UI into a real call |
286
314
  | `dismissCallUI(callId)` | both | Cleans up a call UI that couldn't be resolved |
287
315
  | `updateIncomingCallDisplayName(callId, displayName)` | both | Overrides the shown caller name |
288
316
  | `configureIncomingCallNotification({ enabled?, title?, answerLabel?, declineLabel?, smallIconName? })` | Android | Customizes — or disables — the incoming-call notification self-managed connections require on Android; see [Customizing the Android incoming-call notification](#customizing-the-android-incoming-call-notification). No-op on iOS |
317
+ | `isFullScreenIntentPermissionGranted()` → `boolean` | Android | Always `true` on iOS/pre-14 Android; see [The full-screen-intent permission can be silently revoked](#android-the-full-screen-intent-permission-can-be-silently-revoked) |
318
+ | `requestFullScreenIntentPermission()` | Android | Opens system settings to re-grant it. No-op on iOS/pre-14 Android |
289
319
 
290
320
  Events: `onClientStarted`, `onClientStartFailed`, `onRegistrationCredentialsRequired` (internal — handled by `setRegistrationCredentialsProvider`), `onIncomingCall`, `onCallProgressing`, `onCallEstablished`, `onCallEnded`, `onPushTokenRegistered`, `onPushTokenRegistrationFailed`, `onVoipPushTokenUpdated` (iOS — forward to your backend), `onIncomingCallUIShown`, `onCallUIAnswered`, `onCallUIDeclined`, `onIncomingCallUICancelled`.
291
321
 
@@ -12,6 +12,13 @@
12
12
  Android's own docs for CAPABILITY_SELF_MANAGED require. -->
13
13
  <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
14
14
 
15
+ <!-- Android 14+ requires a foreground service of these types to keep
16
+ capturing microphone audio once the app is backgrounded during an
17
+ active call — see SinchCallForegroundService. -->
18
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
19
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
20
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
21
+
15
22
  <application>
16
23
  <service
17
24
  android:name="com.sinchcalling.telecom.SinchConnectionService"
@@ -22,6 +29,11 @@
22
29
  </intent-filter>
23
30
  </service>
24
31
 
32
+ <service
33
+ android:name="com.sinchcalling.telecom.SinchCallForegroundService"
34
+ android:exported="false"
35
+ android:foregroundServiceType="phoneCall|microphone" />
36
+
25
37
  <!-- Answer/Decline tapped on the incoming-call notification — handled at
26
38
  the native Telecom layer so it works even before JS has started. -->
27
39
  <receiver
@@ -145,8 +145,8 @@ class SinchCallManager(private val context: Context) {
145
145
  // instead of `"incoming_call"`. Checked before the incoming-call match in
146
146
  // `relayRemotePushNotification`, so a payload satisfying both is treated
147
147
  // as a cancel.
148
- fun configureCustomCancelCallPush(typeField: String, cancelValue: String) {
149
- SinchTelecomManager.configureCustomCancelCallPush(typeField, cancelValue)
148
+ fun configureCustomCancelCallPush(typeField: String, cancelValue: String, reasonField: String? = null) {
149
+ SinchTelecomManager.configureCustomCancelCallPush(typeField, cancelValue, reasonField)
150
150
  }
151
151
 
152
152
  fun relayRemotePushNotification(payload: Map<String, String>) {
@@ -156,7 +156,8 @@ class SinchCallManager(private val context: Context) {
156
156
  val typeField = SinchTelecomManager.customCancelTypeField
157
157
  val cancelValue = SinchTelecomManager.customCancelValue
158
158
  if (typeField != null && cancelValue != null && payload[typeField] == cancelValue) {
159
- SinchTelecomManager.reportCallEnded(callId)
159
+ val reason = SinchTelecomManager.customCancelReasonField?.let { payload[it] }
160
+ SinchTelecomManager.reportCallCancelled(callId, reason)
160
161
  listener?.onIncomingCallUICancelled(callId)
161
162
  return
162
163
  }
@@ -25,6 +25,6 @@ object SinchCallingBootstrap {
25
25
  fun eagerlyConfigureCustomIncomingCallPush(context: Context) {
26
26
  SinchTelecomManager.registerPhoneAccount(context.applicationContext)
27
27
  SinchTelecomManager.configureCustomIncomingCallPush("callId", "callerNumber")
28
- SinchTelecomManager.configureCustomCancelCallPush("type", "call_cancelled")
28
+ SinchTelecomManager.configureCustomCancelCallPush("type", "call_cancelled", "reason")
29
29
  }
30
30
  }
@@ -3,6 +3,7 @@ package com.sinchcalling
3
3
  import com.facebook.react.bridge.Arguments
4
4
  import com.facebook.react.bridge.ReactApplicationContext
5
5
  import com.facebook.react.bridge.ReadableMap
6
+ import com.sinchcalling.telecom.SinchFullScreenIntentPermission
6
7
 
7
8
  class SinchCallingModule(reactContext: ReactApplicationContext) :
8
9
  NativeSinchCallingSpec(reactContext) {
@@ -124,8 +125,8 @@ class SinchCallingModule(reactContext: ReactApplicationContext) :
124
125
  callManager.configureCustomIncomingCallPush(idField, displayField)
125
126
  }
126
127
 
127
- override fun configureCustomCancelCallPush(typeField: String, cancelValue: String) {
128
- callManager.configureCustomCancelCallPush(typeField, cancelValue)
128
+ override fun configureCustomCancelCallPush(typeField: String, cancelValue: String, reasonField: String?) {
129
+ callManager.configureCustomCancelCallPush(typeField, cancelValue, reasonField)
129
130
  }
130
131
 
131
132
  override fun reportIncomingCallUI(callId: String, displayName: String) {
@@ -196,6 +197,14 @@ class SinchCallingModule(reactContext: ReactApplicationContext) :
196
197
  )
197
198
  }
198
199
 
200
+ override fun isFullScreenIntentPermissionGranted(): Boolean {
201
+ return SinchFullScreenIntentPermission.isGranted(reactApplicationContext)
202
+ }
203
+
204
+ override fun requestFullScreenIntentPermission() {
205
+ SinchFullScreenIntentPermission.request(reactApplicationContext)
206
+ }
207
+
199
208
  companion object {
200
209
  const val NAME = NativeSinchCallingSpec.NAME
201
210
  }
@@ -0,0 +1,64 @@
1
+ package com.sinchcalling.telecom
2
+
3
+ import android.app.Service
4
+ import android.content.Context
5
+ import android.content.Intent
6
+ import android.content.pm.ServiceInfo
7
+ import android.os.Build
8
+ import android.os.IBinder
9
+
10
+ /**
11
+ * Android 14 (API 34) restricts starting/continuing microphone capture from
12
+ * a backgrounded app to processes running a foreground service declared with
13
+ * `FOREGROUND_SERVICE_TYPE_MICROPHONE` (also `PHONE_CALL` here, since that's
14
+ * literally what this is). A `CAPABILITY_SELF_MANAGED` Telecom connection
15
+ * gets no such service for free — the ringing notification
16
+ * (`SinchIncomingCallNotification`) only covers the ringing phase, so once a
17
+ * call goes active this service takes over for as long as the call runs,
18
+ * started/stopped in lockstep with the connection lifecycle by
19
+ * `SinchTelecomManager.reportCallActive`/`reportCallEnded`.
20
+ */
21
+ class SinchCallForegroundService : Service() {
22
+ override fun onBind(intent: Intent?): IBinder? = null
23
+
24
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
25
+ val callId = intent?.getStringExtra(SinchTelecomManager.EXTRA_CALL_ID) ?: ""
26
+ val displayName = intent?.getStringExtra(EXTRA_DISPLAY_NAME)
27
+ val notification = SinchIncomingCallNotification.buildOngoingCallNotification(this, callId, displayName)
28
+
29
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
30
+ startForeground(
31
+ NOTIFICATION_ID,
32
+ notification,
33
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL or ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
34
+ )
35
+ } else {
36
+ startForeground(NOTIFICATION_ID, notification)
37
+ }
38
+ return START_NOT_STICKY
39
+ }
40
+
41
+ companion object {
42
+ // Arbitrary, fixed id — unlike the per-call ringing/missed-call
43
+ // notifications, only one call is ever active at a time, so there's
44
+ // nothing to disambiguate.
45
+ private const val NOTIFICATION_ID = 837_612_991
46
+ private const val EXTRA_DISPLAY_NAME = "com.sinchcalling.EXTRA_DISPLAY_NAME"
47
+
48
+ fun start(context: Context, callId: String, displayName: String?) {
49
+ val intent = Intent(context, SinchCallForegroundService::class.java).apply {
50
+ putExtra(SinchTelecomManager.EXTRA_CALL_ID, callId)
51
+ putExtra(EXTRA_DISPLAY_NAME, displayName)
52
+ }
53
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
54
+ context.startForegroundService(intent)
55
+ } else {
56
+ context.startService(intent)
57
+ }
58
+ }
59
+
60
+ fun stop(context: Context) {
61
+ context.stopService(Intent(context, SinchCallForegroundService::class.java))
62
+ }
63
+ }
64
+ }
@@ -0,0 +1,40 @@
1
+ package com.sinchcalling.telecom
2
+
3
+ import android.app.NotificationManager
4
+ import android.content.Context
5
+ import android.content.Intent
6
+ import android.net.Uri
7
+ import android.os.Build
8
+ import android.provider.Settings
9
+
10
+ /**
11
+ * `USE_FULL_SCREEN_INTENT` (declared in the manifest, used by
12
+ * `SinchIncomingCallNotification` to ring over the lock screen) is
13
+ * auto-revoked on Android 14+ for apps the OS doesn't recognize as a
14
+ * "calling" app, as of the January 2025 Play policy change — silently, with
15
+ * no callback. A revoked permission doesn't fail loudly either: the
16
+ * notification still posts, it just never launches the full-screen intent,
17
+ * so a call arriving while locked shows nothing until the user unlocks and
18
+ * pulls down the shade. Consumer apps should check this (e.g. on launch, or
19
+ * right before going to the background) and prompt the user to re-grant it
20
+ * if needed.
21
+ */
22
+ object SinchFullScreenIntentPermission {
23
+ fun isGranted(context: Context): Boolean {
24
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) return true
25
+ val manager = context.getSystemService(NotificationManager::class.java) ?: return true
26
+ return manager.canUseFullScreenIntent()
27
+ }
28
+
29
+ // Opens the system settings screen where the user can grant/re-grant the
30
+ // permission. No-op pre-14, where the permission is granted automatically
31
+ // at install time and can't be revoked this way.
32
+ fun request(context: Context) {
33
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) return
34
+ val intent = Intent(Settings.ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT).apply {
35
+ data = Uri.fromParts("package", context.packageName, null)
36
+ addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
37
+ }
38
+ context.applicationContext.startActivity(intent)
39
+ }
40
+ }
@@ -6,6 +6,8 @@ import android.app.NotificationManager
6
6
  import android.app.PendingIntent
7
7
  import android.content.Context
8
8
  import android.content.Intent
9
+ import android.media.AudioAttributes
10
+ import android.media.RingtoneManager
9
11
  import android.os.Build
10
12
 
11
13
  /**
@@ -25,6 +27,17 @@ import android.os.Build
25
27
  */
26
28
  internal object SinchIncomingCallNotification {
27
29
  private const val CHANNEL_ID = "sinch_incoming_calls"
30
+ // Separate, lower-priority channel for the "you missed a call" / "call was
31
+ // forwarded" notice left behind once a cancel push tears down the ringing
32
+ // notification above — a plain heads-up, not full-screen/ongoing, so it
33
+ // behaves like any other missed-call notification instead of ringing again.
34
+ private const val MISSED_CHANNEL_ID = "sinch_missed_calls"
35
+ // Silent, low-importance channel for the ongoing-call notification a
36
+ // foreground service must show while a call is active — see
37
+ // `SinchCallForegroundService`. Distinct from the ringing channel above,
38
+ // which needs to be loud and heads-up; this one should be as unobtrusive
39
+ // as a normal "call in progress" system notification.
40
+ private const val ACTIVE_CALL_CHANNEL_ID = "sinch_active_call"
28
41
  internal const val ACTION_ANSWER = "com.sinchcalling.action.ANSWER_CALL"
29
42
  internal const val ACTION_DECLINE = "com.sinchcalling.action.DECLINE_CALL"
30
43
 
@@ -83,7 +96,7 @@ internal object SinchIncomingCallNotification {
83
96
 
84
97
  // Falls back to the host app's launcher icon if no override was
85
98
  // configured, or the configured drawable name doesn't resolve.
86
- private fun resolveSmallIcon(context: Context, iconName: String?): Int {
99
+ internal fun resolveSmallIcon(context: Context, iconName: String?): Int {
87
100
  if (!iconName.isNullOrBlank()) {
88
101
  val resId = context.resources.getIdentifier(iconName, "drawable", context.packageName)
89
102
  if (resId != 0) return resId
@@ -93,6 +106,21 @@ internal object SinchIncomingCallNotification {
93
106
 
94
107
  private fun notificationId(callId: String): Int = callId.hashCode()
95
108
 
109
+ // Distinct from `notificationId` so the missed/forwarded notice (posted
110
+ // after the ringing one has already been cancelled) never collides with
111
+ // — or gets silently clobbered by a race with — the ringing notification
112
+ // for the same callId.
113
+ private fun missedNoticeId(callId: String): Int = callId.hashCode() xor MISSED_NOTICE_ID_SALT
114
+ private const val MISSED_NOTICE_ID_SALT = -0x4d495353 // "MISS", arbitrary distinguishing bit pattern
115
+
116
+ // The ringing notification only carries the caller name for as long as
117
+ // it's showing (see `show`/`cancel`) — captured here so
118
+ // `SinchTelecomManager.reportCallCancelled` can read it before tearing the
119
+ // ringing notification (and this map entry) down via `reportCallEnded`.
120
+ private val activeDisplayNames = mutableMapOf<String, String>()
121
+
122
+ fun displayNameFor(callId: String): String? = activeDisplayNames[callId]
123
+
96
124
  private fun ensureChannel(context: Context) {
97
125
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return
98
126
  val manager = context.getSystemService(NotificationManager::class.java) ?: return
@@ -106,6 +134,32 @@ internal object SinchIncomingCallNotification {
106
134
  setBypassDnd(true)
107
135
  enableVibration(true)
108
136
  lockscreenVisibility = Notification.VISIBILITY_PUBLIC
137
+ // The device's actual ringtone (ringer stream), not the default
138
+ // notification blip — this is only reachable while foregrounded
139
+ // Socket.IO isn't already driving the in-app ring UI (see
140
+ // pushNotificationService.ts's foreground handler), so there's no
141
+ // double-ring risk with the JS-side ringtone.
142
+ setSound(
143
+ RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE),
144
+ AudioAttributes.Builder()
145
+ .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
146
+ .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE)
147
+ .build()
148
+ )
149
+ }
150
+ manager.createNotificationChannel(channel)
151
+ }
152
+
153
+ private fun ensureMissedChannel(context: Context) {
154
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return
155
+ val manager = context.getSystemService(NotificationManager::class.java) ?: return
156
+ if (manager.getNotificationChannel(MISSED_CHANNEL_ID) != null) return
157
+ val channel = NotificationChannel(
158
+ MISSED_CHANNEL_ID,
159
+ "Missed calls",
160
+ NotificationManager.IMPORTANCE_DEFAULT
161
+ ).apply {
162
+ description = "Missed and forwarded call notices"
109
163
  }
110
164
  manager.createNotificationChannel(channel)
111
165
  }
@@ -147,6 +201,7 @@ internal object SinchIncomingCallNotification {
147
201
  val appContext = context.applicationContext
148
202
  val config = readConfig(appContext)
149
203
  if (!config.enabled) return
204
+ activeDisplayNames[callId] = displayName
150
205
  ensureChannel(appContext)
151
206
 
152
207
  val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@@ -177,7 +232,88 @@ internal object SinchIncomingCallNotification {
177
232
  }
178
233
 
179
234
  fun cancel(context: Context, callId: String) {
235
+ activeDisplayNames.remove(callId)
180
236
  val manager = context.applicationContext.getSystemService(NotificationManager::class.java) ?: return
181
237
  manager.cancel(notificationId(callId))
182
238
  }
239
+
240
+ // A still-ringing call was called off by a custom cancel push (see
241
+ // `SinchTelecomManager.reportCallCancelled`) — the ringing notification is
242
+ // already gone by the time this runs, so post a plain, dismissible notice
243
+ // explaining why the phone stopped ringing instead of leaving the rep to
244
+ // wonder. `reason == "FORWARDED"` gets a distinct "call forwarded" notice;
245
+ // every other reason (answered elsewhere, declined, hung up, ...) reads as
246
+ // a plain missed call.
247
+ fun showCancelledNotice(context: Context, callId: String, reason: String?, displayName: String?) {
248
+ val appContext = context.applicationContext
249
+ val config = readConfig(appContext)
250
+ if (!config.enabled) return
251
+ ensureMissedChannel(appContext)
252
+
253
+ val forwarded = reason == "FORWARDED"
254
+ val title = if (forwarded) "Call forwarded" else "Missed call"
255
+ val text = displayName?.takeIf { it.isNotBlank() } ?: "Unknown"
256
+
257
+ val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
258
+ Notification.Builder(appContext, MISSED_CHANNEL_ID)
259
+ } else {
260
+ @Suppress("DEPRECATION")
261
+ Notification.Builder(appContext)
262
+ }
263
+
264
+ builder
265
+ .setSmallIcon(resolveSmallIcon(appContext, config.smallIconName))
266
+ .setContentTitle(title)
267
+ .setContentText(text)
268
+ .setCategory(Notification.CATEGORY_CALL)
269
+ .setAutoCancel(true)
270
+ .setOngoing(false)
271
+
272
+ launchPendingIntent(appContext, callId)?.let { builder.setContentIntent(it) }
273
+
274
+ val manager = appContext.getSystemService(NotificationManager::class.java) ?: return
275
+ manager.notify(missedNoticeId(callId), builder.build())
276
+ }
277
+
278
+ private fun ensureActiveCallChannel(context: Context) {
279
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return
280
+ val manager = context.getSystemService(NotificationManager::class.java) ?: return
281
+ if (manager.getNotificationChannel(ACTIVE_CALL_CHANNEL_ID) != null) return
282
+ val channel = NotificationChannel(
283
+ ACTIVE_CALL_CHANNEL_ID,
284
+ "Ongoing call",
285
+ NotificationManager.IMPORTANCE_LOW
286
+ ).apply {
287
+ description = "Shown while a call is in progress"
288
+ }
289
+ manager.createNotificationChannel(channel)
290
+ }
291
+
292
+ // Built for `SinchCallForegroundService.onStartCommand` — every foreground
293
+ // service must call `startForeground` with a notification within a few
294
+ // seconds of starting, regardless of whether the ringing notification is
295
+ // already showing (it isn't, by the time a call is active).
296
+ internal fun buildOngoingCallNotification(context: Context, callId: String, displayName: String?): Notification {
297
+ val appContext = context.applicationContext
298
+ val config = readConfig(appContext)
299
+ ensureActiveCallChannel(appContext)
300
+
301
+ val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
302
+ Notification.Builder(appContext, ACTIVE_CALL_CHANNEL_ID)
303
+ } else {
304
+ @Suppress("DEPRECATION")
305
+ Notification.Builder(appContext)
306
+ }
307
+
308
+ builder
309
+ .setSmallIcon(resolveSmallIcon(appContext, config.smallIconName))
310
+ .setContentTitle("Call in progress")
311
+ .setContentText(displayName?.takeIf { it.isNotBlank() })
312
+ .setCategory(Notification.CATEGORY_CALL)
313
+ .setOngoing(true)
314
+
315
+ launchPendingIntent(appContext, callId)?.let { builder.setContentIntent(it) }
316
+
317
+ return builder.build()
318
+ }
183
319
  }
@@ -45,6 +45,8 @@ object SinchTelecomManager {
45
45
  private set
46
46
  internal var customCancelValue: String? = null
47
47
  private set
48
+ internal var customCancelReasonField: String? = null
49
+ private set
48
50
 
49
51
  // Opts into recognizing the consumer app's own backend's incoming-call
50
52
  // push payloads. Until called, every payload is relayed straight to Sinch
@@ -55,10 +57,14 @@ object SinchTelecomManager {
55
57
  }
56
58
 
57
59
  // Opts into recognizing a cancel/end push shaped like the configured
58
- // incoming-call push but carrying `typeField == cancelValue`.
59
- fun configureCustomCancelCallPush(typeField: String, cancelValue: String) {
60
+ // incoming-call push but carrying `typeField == cancelValue`. `reasonField`
61
+ // is optional — if the payload carries one (e.g. "FORWARDED" vs anything
62
+ // else), it's used to show a distinct missed-vs-forwarded notice instead
63
+ // of just silently dismissing the ringing notification.
64
+ fun configureCustomCancelCallPush(typeField: String, cancelValue: String, reasonField: String? = null) {
60
65
  customCancelTypeField = typeField
61
66
  customCancelValue = cancelValue
67
+ customCancelReasonField = reasonField
62
68
  }
63
69
 
64
70
  fun phoneAccountHandle(context: Context): PhoneAccountHandle {
@@ -137,7 +143,13 @@ object SinchTelecomManager {
137
143
 
138
144
  fun reportCallActive(callId: String) {
139
145
  connections[callId]?.setActive()
140
- appContext?.let { SinchIncomingCallNotification.cancel(it, callId) }
146
+ appContext?.let { ctx ->
147
+ // Read before `cancel` below, which forgets the caller name along with
148
+ // dismissing the ringing notification.
149
+ val displayName = SinchIncomingCallNotification.displayNameFor(callId)
150
+ SinchCallForegroundService.start(ctx, callId, displayName)
151
+ SinchIncomingCallNotification.cancel(ctx, callId)
152
+ }
141
153
  }
142
154
 
143
155
  fun reportCallEnded(callId: String) {
@@ -147,7 +159,23 @@ object SinchTelecomManager {
147
159
  }
148
160
  connections.remove(callId)
149
161
  externallyReportedCallIds.remove(callId)
150
- appContext?.let { SinchIncomingCallNotification.cancel(it, callId) }
162
+ appContext?.let {
163
+ SinchIncomingCallNotification.cancel(it, callId)
164
+ SinchCallForegroundService.stop(it)
165
+ }
166
+ }
167
+
168
+ // Distinct from `reportCallEnded` (used for every call ending, including a
169
+ // normal hangup after the call was answered) — this is specifically for a
170
+ // still-ringing call being called off by a custom cancel push, so unlike a
171
+ // plain call-ended it's worth telling the rep why the phone stopped
172
+ // ringing instead of just silently dropping the notification.
173
+ fun reportCallCancelled(callId: String, reason: String?) {
174
+ // Must read before `reportCallEnded`, which cancels the ringing
175
+ // notification and forgets the caller name along with it.
176
+ val displayName = SinchIncomingCallNotification.displayNameFor(callId)
177
+ reportCallEnded(callId)
178
+ appContext?.let { SinchIncomingCallNotification.showCancelledNotice(it, callId, reason, displayName) }
151
179
  }
152
180
 
153
181
  internal fun registerConnection(callId: String, connection: SinchConnection) {
@@ -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
  }
@@ -48,7 +48,7 @@ static void SinchCallingEnsureSharedManagers(void)
48
48
  #endif
49
49
  [sSharedPushManager enableWithUseProductionAps:useProductionAps];
50
50
  [sSharedPushManager configureCustomIncomingCallPushWithIdField:@"callId" displayField:@"callerNumber"];
51
- [sSharedPushManager configureCustomCancelCallPushWithTypeField:@"type" cancelValue:@"call_cancelled"];
51
+ [sSharedPushManager configureCustomCancelCallPushWithTypeField:@"type" cancelValue:@"call_cancelled" reasonField:@"reason"];
52
52
  }
53
53
 
54
54
  - (instancetype)init
@@ -115,9 +115,11 @@ static void SinchCallingEnsureSharedManagers(void)
115
115
  [_pushManager configureCustomIncomingCallPushWithIdField:idField displayField:displayField];
116
116
  }
117
117
 
118
- - (void)configureCustomCancelCallPush:(NSString *)typeField cancelValue:(NSString *)cancelValue
118
+ - (void)configureCustomCancelCallPush:(NSString *)typeField cancelValue:(NSString *)cancelValue reasonField:(NSString *)reasonField
119
119
  {
120
- [_pushManager configureCustomCancelCallPushWithTypeField:typeField cancelValue:cancelValue];
120
+ // `reasonField` drives a missed-vs-forwarded local notification posted via
121
+ // SinchMissedCallNotifier once the already-visible CallKit screen ends.
122
+ [_pushManager configureCustomCancelCallPushWithTypeField:typeField cancelValue:cancelValue reasonField:reasonField];
121
123
  }
122
124
 
123
125
  - (void)reportIncomingCallUI:(NSString *)callId displayName:(NSString *)displayName
@@ -154,6 +156,18 @@ static void SinchCallingEnsureSharedManagers(void)
154
156
  // Android only — iOS uses CallKit's own system UI, nothing to customize here.
155
157
  }
156
158
 
159
+ - (BOOL)isFullScreenIntentPermissionGranted
160
+ {
161
+ // Android only — this whole permission concept doesn't exist on iOS,
162
+ // which uses CallKit's own system UI (no equivalent revocable permission).
163
+ return YES;
164
+ }
165
+
166
+ - (void)requestFullScreenIntentPermission
167
+ {
168
+ // Android only — no-op on iOS, see isFullScreenIntentPermissionGranted.
169
+ }
170
+
157
171
  - (void)answerCall:(NSString *)callId
158
172
  {
159
173
  [_callManager answerCall:callId];
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSinchCalling.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;AAmLpE,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;AA6MpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,cAAc,CAAC","ignoreList":[]}
@@ -130,9 +130,15 @@ class SinchCalling {
130
130
  * carrying both the id field and this cancel marker ends the already-shown
131
131
  * call UI instead of being reported as a new incoming call. Has no effect
132
132
  * until `configureCustomIncomingCallPush` has also been called.
133
+ *
134
+ * `reasonField` — if your payload also carries a reason (e.g.
135
+ * `{ ..., reason: 'FORWARDED' }`), naming that field here makes both
136
+ * platforms show a distinct "call forwarded" vs "missed call" notice
137
+ * (a heads-up notification on Android, a local notification on iOS)
138
+ * instead of just silently dismissing the ringing call UI.
133
139
  */
134
- configureCustomCancelCallPush(typeField, cancelValue) {
135
- NativeSinchCalling.configureCustomCancelCallPush(typeField, cancelValue);
140
+ configureCustomCancelCallPush(typeField, cancelValue, reasonField) {
141
+ NativeSinchCalling.configureCustomCancelCallPush(typeField, cancelValue, reasonField);
136
142
  }
137
143
 
138
144
  /**
@@ -182,6 +188,27 @@ class SinchCalling {
182
188
  NativeSinchCalling.configureIncomingCallNotification(config);
183
189
  }
184
190
 
191
+ /**
192
+ * Android only. Android 14+ can silently auto-revoke
193
+ * `USE_FULL_SCREEN_INTENT`, breaking the lock-screen ring in
194
+ * `configureIncomingCallNotification` with no visible error. Always
195
+ * returns `true` on iOS and pre-14 Android. Check on app launch (or
196
+ * whenever returning to the foreground) and call
197
+ * `requestFullScreenIntentPermission` if this comes back `false`.
198
+ */
199
+ isFullScreenIntentPermissionGranted() {
200
+ return NativeSinchCalling.isFullScreenIntentPermissionGranted();
201
+ }
202
+
203
+ /**
204
+ * Android only. Opens the system settings screen where the user can
205
+ * grant/re-grant `USE_FULL_SCREEN_INTENT`. No-op on iOS and pre-14
206
+ * Android.
207
+ */
208
+ requestFullScreenIntentPermission() {
209
+ NativeSinchCalling.requestFullScreenIntentPermission();
210
+ }
211
+
185
212
  /** iOS only: hex-encoded PushKit VoIP token, issued on start and on rotation. */
186
213
  onVoipPushTokenUpdated(listener) {
187
214
  return NativeSinchCalling.onVoipPushTokenUpdated(listener);
@@ -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","reportIncomingCallUI","displayName","onPushTokenRegistered","onPushTokenRegistrationFailed","resolveCallUIToConference","dismissCallUI","updateIncomingCallDisplayName","configureIncomingCallNotification","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,CAA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OtB,kBAAkB,CAACiE,qBAAqB,CAAC3C,QAAQ,CAAC;EAC3D;;EAEA;EACA4C,gBAAgBA,CACd5C,QAA8C,EAC3B;IACnB,OAAOtB,kBAAkB,CAACkE,gBAAgB,CAAC5C,QAAQ,CAAC;EACtD;;EAEA;EACA6C,gBAAgBA,CACd7C,QAA8C,EAC3B;IACnB,OAAOtB,kBAAkB,CAACmE,gBAAgB,CAAC7C,QAAQ,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE8C,yBAAyBA,CACvB9C,QAAuD,EACpC;IACnB,OAAOtB,kBAAkB,CAACoE,yBAAyB,CAAC9C,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","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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C;;EAEA;EACAgC,6BAA6BA,CAAChC,MAAc,EAAE2B,WAAmB,EAAQ;IACvE1D,kBAAkB,CAAC+D,6BAA6B,CAAChC,MAAM,EAAE2B,WAAW,CAAC;EACvE;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,iCAAiCA,CAC/B5D,MAAsC,EAChC;IACNJ,kBAAkB,CAACgE,iCAAiC,CAAC5D,MAAM,CAAC;EAC9D;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACE6D,mCAAmCA,CAAA,EAAY;IAC7C,OAAOjE,kBAAkB,CAACiE,mCAAmC,CAAC,CAAC;EACjE;;EAEA;AACF;AACA;AACA;AACA;EACEC,iCAAiCA,CAAA,EAAS;IACxClE,kBAAkB,CAACkE,iCAAiC,CAAC,CAAC;EACxD;;EAEA;EACAC,sBAAsBA,CACpB7C,QAA6C,EAC1B;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":[]}
@@ -49,12 +49,14 @@ export interface Spec extends TurboModule {
49
49
  enablePushNotifications(useProductionAps: boolean): void;
50
50
  relayRemotePushNotification(payload: Object): void;
51
51
  configureCustomIncomingCallPush(idField: string, displayField: string): void;
52
- configureCustomCancelCallPush(typeField: string, cancelValue: string): void;
52
+ configureCustomCancelCallPush(typeField: string, cancelValue: string, reasonField?: string): void;
53
53
  reportIncomingCallUI(callId: string, displayName: string): void;
54
54
  resolveCallUIToConference(callId: string, conferenceId: string, callerId: string): string;
55
55
  dismissCallUI(callId: string): void;
56
56
  updateIncomingCallDisplayName(callId: string, displayName: string): void;
57
57
  configureIncomingCallNotification(config: Object): void;
58
+ isFullScreenIntentPermissionGranted(): boolean;
59
+ requestFullScreenIntentPermission(): void;
58
60
  onClientStarted: CodegenTypes.EventEmitter<void>;
59
61
  onClientStartFailed: CodegenTypes.EventEmitter<ClientStartFailedEvent>;
60
62
  onRegistrationCredentialsRequired: CodegenTypes.EventEmitter<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,mBAAmB;IAClC,M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
89
  * carrying both the id field and this cancel marker ends the already-shown
90
90
  * call UI instead of being reported as a new incoming call. Has no effect
91
91
  * until `configureCustomIncomingCallPush` has also been called.
92
+ *
93
+ * `reasonField` — if your payload also carries a reason (e.g.
94
+ * `{ ..., reason: 'FORWARDED' }`), naming that field here makes both
95
+ * platforms show a distinct "call forwarded" vs "missed call" notice
96
+ * (a heads-up notification on Android, a local notification on iOS)
97
+ * instead of just silently dismissing the ringing call UI.
92
98
  */
93
- configureCustomCancelCallPush(typeField: string, cancelValue: string): void;
99
+ configureCustomCancelCallPush(typeField: string, cancelValue: string, reasonField?: string): void;
94
100
  /**
95
101
  * Reports a system call UI (CallKit / Telecom) for a call your own app
96
102
  * logic decided to show — from a custom push, a Socket.IO event, or
@@ -119,6 +125,21 @@ declare class SinchCalling {
119
125
  * once during setup, before any call can ring. No-op on iOS.
120
126
  */
121
127
  configureIncomingCallNotification(config: IncomingCallNotificationConfig): void;
128
+ /**
129
+ * Android only. Android 14+ can silently auto-revoke
130
+ * `USE_FULL_SCREEN_INTENT`, breaking the lock-screen ring in
131
+ * `configureIncomingCallNotification` with no visible error. Always
132
+ * returns `true` on iOS and pre-14 Android. Check on app launch (or
133
+ * whenever returning to the foreground) and call
134
+ * `requestFullScreenIntentPermission` if this comes back `false`.
135
+ */
136
+ isFullScreenIntentPermissionGranted(): boolean;
137
+ /**
138
+ * Android only. Opens the system settings screen where the user can
139
+ * grant/re-grant `USE_FULL_SCREEN_INTENT`. No-op on iOS and pre-14
140
+ * Android.
141
+ */
142
+ requestFullScreenIntentPermission(): void;
122
143
  /** iOS only: hex-encoded PushKit VoIP token, issued on start and on rotation. */
123
144
  onVoipPushTokenUpdated(listener: (event: VoipPushTokenEvent) => void): EventSubscription;
124
145
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SinchCalling.d.ts","sourceRoot":"","sources":["../../../src/SinchCalling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAA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;IAQT,6EAA6E;IAC7E,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAInC,sGAAsG;IACtG,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAIxE;;;;;;;OAOG;IACH,iCAAiC,CAC/B,MAAM,EAAE,8BAA8B,GACrC,IAAI;IAIP;;;;;;;OAOG;IACH,mCAAmC,IAAI,OAAO;IAI9C;;;;OAIG;IACH,iCAAiC,IAAI,IAAI;IAIzC,iFAAiF;IACjF,sBAAsB,CACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,GAC5C,iBAAiB;IAIpB;;;;OAIG;IACH,qBAAqB,CACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAC7C,iBAAiB;IAIpB,wEAAwE;IACxE,gBAAgB,CACd,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAC7C,iBAAiB;IAIpB,wEAAwE;IACxE,gBAAgB,CACd,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAC7C,iBAAiB;IAIpB;;;;;OAKG;IACH,yBAAyB,CACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,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.8.0",
3
+ "version": "0.10.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",
@@ -100,7 +100,20 @@ export interface Spec extends TurboModule {
100
100
  // instead of being reported as a new incoming call. Has no effect until
101
101
  // `configureCustomIncomingCallPush` has also been called (there'd be no
102
102
  // `callId` field to key off of otherwise).
103
- configureCustomCancelCallPush(typeField: string, cancelValue: string): void;
103
+ // `reasonField` is optional — if your backend's cancel push carries a
104
+ // reason (e.g. `{ type: "call_cancelled", callId, reason: "FORWARDED" }`),
105
+ // naming that field here lets a "forwarded" cancel be told apart from any
106
+ // other reason (declined, hung up, answered elsewhere, ...), which
107
+ // `onIncomingCallUICancelled` doesn't otherwise distinguish. Drives a
108
+ // missed/forwarded notice on both platforms once the ringing call UI ends:
109
+ // a heads-up notification on Android, a local notification on iOS (since
110
+ // CallKit's system call screen just disappears with no explanation
111
+ // otherwise).
112
+ configureCustomCancelCallPush(
113
+ typeField: string,
114
+ cancelValue: string,
115
+ reasonField?: string
116
+ ): void;
104
117
 
105
118
  // Reports a system call UI (CallKit / Telecom) for a call your own app
106
119
  // logic decided to show — from a custom push, a Socket.IO event, or
@@ -139,6 +152,19 @@ export interface Spec extends TurboModule {
139
152
  // — see `IncomingCallNotificationConfig` in `SinchCalling.ts`.
140
153
  configureIncomingCallNotification(config: Object): void;
141
154
 
155
+ // Android only. Android 14+ auto-revokes `USE_FULL_SCREEN_INTENT` for apps
156
+ // it doesn't recognize as a "calling" app — silently, with no callback —
157
+ // which breaks the lock-screen ring in `SinchIncomingCallNotification`
158
+ // without any visible error. Always true on iOS and pre-14 Android. Check
159
+ // this (e.g. on app launch) and call `requestFullScreenIntentPermission`
160
+ // if it comes back false.
161
+ isFullScreenIntentPermissionGranted(): boolean;
162
+
163
+ // Android only. Opens the system settings screen where the user can
164
+ // grant/re-grant `USE_FULL_SCREEN_INTENT`. No-op on iOS and pre-14
165
+ // Android.
166
+ requestFullScreenIntentPermission(): void;
167
+
142
168
  onClientStarted: CodegenTypes.EventEmitter<void>;
143
169
  onClientStartFailed: CodegenTypes.EventEmitter<ClientStartFailedEvent>;
144
170
  onRegistrationCredentialsRequired: CodegenTypes.EventEmitter<void>;
@@ -192,9 +192,23 @@ class SinchCalling {
192
192
  * carrying both the id field and this cancel marker ends the already-shown
193
193
  * call UI instead of being reported as a new incoming call. Has no effect
194
194
  * until `configureCustomIncomingCallPush` has also been called.
195
+ *
196
+ * `reasonField` — if your payload also carries a reason (e.g.
197
+ * `{ ..., reason: 'FORWARDED' }`), naming that field here makes both
198
+ * platforms show a distinct "call forwarded" vs "missed call" notice
199
+ * (a heads-up notification on Android, a local notification on iOS)
200
+ * instead of just silently dismissing the ringing call UI.
195
201
  */
196
- configureCustomCancelCallPush(typeField: string, cancelValue: string): void {
197
- NativeSinchCalling.configureCustomCancelCallPush(typeField, cancelValue);
202
+ configureCustomCancelCallPush(
203
+ typeField: string,
204
+ cancelValue: string,
205
+ reasonField?: string
206
+ ): void {
207
+ NativeSinchCalling.configureCustomCancelCallPush(
208
+ typeField,
209
+ cancelValue,
210
+ reasonField
211
+ );
198
212
  }
199
213
 
200
214
  /**
@@ -258,6 +272,27 @@ class SinchCalling {
258
272
  NativeSinchCalling.configureIncomingCallNotification(config);
259
273
  }
260
274
 
275
+ /**
276
+ * Android only. Android 14+ can silently auto-revoke
277
+ * `USE_FULL_SCREEN_INTENT`, breaking the lock-screen ring in
278
+ * `configureIncomingCallNotification` with no visible error. Always
279
+ * returns `true` on iOS and pre-14 Android. Check on app launch (or
280
+ * whenever returning to the foreground) and call
281
+ * `requestFullScreenIntentPermission` if this comes back `false`.
282
+ */
283
+ isFullScreenIntentPermissionGranted(): boolean {
284
+ return NativeSinchCalling.isFullScreenIntentPermissionGranted();
285
+ }
286
+
287
+ /**
288
+ * Android only. Opens the system settings screen where the user can
289
+ * grant/re-grant `USE_FULL_SCREEN_INTENT`. No-op on iOS and pre-14
290
+ * Android.
291
+ */
292
+ requestFullScreenIntentPermission(): void {
293
+ NativeSinchCalling.requestFullScreenIntentPermission();
294
+ }
295
+
261
296
  /** iOS only: hex-encoded PushKit VoIP token, issued on start and on rotation. */
262
297
  onVoipPushTokenUpdated(
263
298
  listener: (event: VoipPushTokenEvent) => void