react-native-sinch-calling 0.6.2 → 0.7.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/README.md CHANGED
@@ -224,6 +224,34 @@ messaging().onMessage(async (remoteMessage) => {
224
224
 
225
225
  This only works while the app **process** is alive (backgrounded, not killed) — the JS runtime has to be running to receive the FCM callback. iOS doesn't have this limitation: VoIP push wakes the app process via PushKit even when fully killed.
226
226
 
227
+ ### Customizing the Android incoming-call notification
228
+
229
+ A `PhoneAccount.CAPABILITY_SELF_MANAGED` connection — what this library uses under the hood on Android — gets no system-drawn incoming-call screen the way iOS gets from CallKit; Android only tracks call/audio-focus state for it. So the library posts its own notification (title, Answer/Decline actions, a full-screen intent so it's visible over the lock screen). Customize or disable it with `configureIncomingCallNotification`:
230
+
231
+ ```ts
232
+ import { SinchCalling } from 'react-native-sinch-calling';
233
+
234
+ SinchCalling.configureIncomingCallNotification({
235
+ title: 'Incoming call',
236
+ answerLabel: 'Answer',
237
+ declineLabel: 'Decline',
238
+ // Name of a drawable resource in your own app, resolved via
239
+ // `Resources.getIdentifier` — falls back to your app's launcher icon if
240
+ // omitted or not found.
241
+ smallIconName: 'ic_call_notification',
242
+ });
243
+ ```
244
+
245
+ Call this once during setup, before any call can ring. It's persisted natively (`SharedPreferences`), not just held in JS state — so it still applies to a call that arrives before JS has started again (e.g. the process was killed and only woken up to relay the push).
246
+
247
+ Already have your own incoming-call UI and don't want this notification at all? Opt out with `enabled: false` — the underlying self-managed connection (audio routing, Bluetooth, Android Auto, etc.) still registers either way, only the notification is skipped:
248
+
249
+ ```ts
250
+ SinchCalling.configureIncomingCallNotification({ enabled: false });
251
+ ```
252
+
253
+ 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
+
227
255
  ### Retrying after a failure
228
256
 
229
257
  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:
@@ -257,6 +285,7 @@ SinchCalling.onClientStartFailed(({ code }) => {
257
285
  | `resolveCallUIToConference(callId, conferenceId, callerId)` → `callId` | both | Turns a shown call UI into a real call |
258
286
  | `dismissCallUI(callId)` | both | Cleans up a call UI that couldn't be resolved |
259
287
  | `updateIncomingCallDisplayName(callId, displayName)` | both | Overrides the shown caller name |
288
+ | `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 |
260
289
 
261
290
  Events: `onClientStarted`, `onClientStartFailed`, `onRegistrationCredentialsRequired` (internal — handled by `setRegistrationCredentialsProvider`), `onIncomingCall`, `onCallProgressing`, `onCallEstablished`, `onCallEnded`, `onPushTokenRegistered`, `onPushTokenRegistrationFailed`, `onVoipPushTokenUpdated` (iOS — forward to your backend), `onIncomingCallUIShown`, `onCallUIAnswered`, `onCallUIDeclined`, `onIncomingCallUICancelled`.
262
291
 
@@ -6,6 +6,11 @@
6
6
  <uses-permission android:name="android.permission.BLUETOOTH" />
7
7
  <uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
8
8
  <uses-permission android:name="android.permission.WAKE_LOCK" />
9
+ <!-- Self-managed ConnectionService calls get no system-provided incoming-call
10
+ UI — we post our own notification (see SinchIncomingCallNotification)
11
+ with a full-screen intent so it's visible over the lock screen, as
12
+ Android's own docs for CAPABILITY_SELF_MANAGED require. -->
13
+ <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
9
14
 
10
15
  <application>
11
16
  <service
@@ -16,5 +21,11 @@
16
21
  <action android:name="android.telecom.ConnectionService" />
17
22
  </intent-filter>
18
23
  </service>
24
+
25
+ <!-- Answer/Decline tapped on the incoming-call notification — handled at
26
+ the native Telecom layer so it works even before JS has started. -->
27
+ <receiver
28
+ android:name="com.sinchcalling.telecom.SinchCallActionReceiver"
29
+ android:exported="false" />
19
30
  </application>
20
31
  </manifest>
@@ -15,6 +15,7 @@ import com.sinch.android.rtc.calling.CallControllerListener
15
15
  import com.sinch.android.rtc.calling.CallEndCause
16
16
  import com.sinch.android.rtc.calling.CallListener
17
17
  import com.sinch.android.rtc.calling.MediaConstraints
18
+ import com.sinchcalling.telecom.SinchIncomingCallNotification
18
19
  import com.sinchcalling.telecom.SinchTelecomListener
19
20
  import com.sinchcalling.telecom.SinchTelecomManager
20
21
  import java.io.IOException
@@ -197,12 +198,14 @@ class SinchCallManager(private val context: Context) {
197
198
  return
198
199
  }
199
200
 
200
- sinchClient.audioController.enableAutomaticAudioRouting(
201
- AudioController.AudioRoutingConfig(AudioController.UseSpeakerphone.SPEAKERPHONE_AUTO, true)
202
- )
203
-
204
201
  sinchClient.addSinchClientListener(object : SinchClientListener {
205
202
  override fun onClientStarted(client: SinchClient) {
203
+ // `audioController` throws `IllegalStateException: SinchClient not
204
+ // started` if touched before this callback — it's only valid once
205
+ // the client has actually started, not right after `build()`.
206
+ client.audioController.enableAutomaticAudioRouting(
207
+ AudioController.AudioRoutingConfig(AudioController.UseSpeakerphone.SPEAKERPHONE_AUTO, true)
208
+ )
206
209
  listener?.onClientStarted()
207
210
  }
208
211
 
@@ -249,6 +252,18 @@ class SinchCallManager(private val context: Context) {
249
252
  client?.start()
250
253
  }
251
254
 
255
+ // `null` for a given param leaves that setting as previously configured
256
+ // (or the default) — see `SinchIncomingCallNotification.configure`.
257
+ fun configureIncomingCallNotification(
258
+ enabled: Boolean?,
259
+ title: String?,
260
+ answerLabel: String?,
261
+ declineLabel: String?,
262
+ smallIconName: String?
263
+ ) {
264
+ SinchIncomingCallNotification.configure(context, enabled, title, answerLabel, declineLabel, smallIconName)
265
+ }
266
+
252
267
  fun stop() {
253
268
  client?.terminateGracefully()
254
269
  client = null
@@ -186,6 +186,16 @@ class SinchCallingModule(reactContext: ReactApplicationContext) :
186
186
  callManager.relayRemotePushNotification(data)
187
187
  }
188
188
 
189
+ override fun configureIncomingCallNotification(config: ReadableMap) {
190
+ callManager.configureIncomingCallNotification(
191
+ enabled = if (config.hasKey("enabled")) config.getBoolean("enabled") else null,
192
+ title = if (config.hasKey("title")) config.getString("title") else null,
193
+ answerLabel = if (config.hasKey("answerLabel")) config.getString("answerLabel") else null,
194
+ declineLabel = if (config.hasKey("declineLabel")) config.getString("declineLabel") else null,
195
+ smallIconName = if (config.hasKey("smallIconName")) config.getString("smallIconName") else null
196
+ )
197
+ }
198
+
189
199
  companion object {
190
200
  const val NAME = NativeSinchCallingSpec.NAME
191
201
  }
@@ -0,0 +1,23 @@
1
+ package com.sinchcalling.telecom
2
+
3
+ import android.content.BroadcastReceiver
4
+ import android.content.Context
5
+ import android.content.Intent
6
+
7
+ /**
8
+ * Handles Answer/Decline tapped directly on the incoming-call notification
9
+ * (see `SinchIncomingCallNotification`). These operate purely at the
10
+ * Telecom/native layer via `SinchTelecomManager` — the same layer a
11
+ * Bluetooth headset or Android Auto button press goes through — so they
12
+ * work even if the app's JS hasn't started yet (e.g. the process was woken
13
+ * up just to relay the incoming-call push).
14
+ */
15
+ class SinchCallActionReceiver : BroadcastReceiver() {
16
+ override fun onReceive(context: Context, intent: Intent) {
17
+ val callId = intent.getStringExtra(SinchTelecomManager.EXTRA_CALL_ID) ?: return
18
+ when (intent.action) {
19
+ SinchIncomingCallNotification.ACTION_ANSWER -> SinchTelecomManager.answerCall(callId)
20
+ SinchIncomingCallNotification.ACTION_DECLINE -> SinchTelecomManager.declineCall(callId)
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,183 @@
1
+ package com.sinchcalling.telecom
2
+
3
+ import android.app.Notification
4
+ import android.app.NotificationChannel
5
+ import android.app.NotificationManager
6
+ import android.app.PendingIntent
7
+ import android.content.Context
8
+ import android.content.Intent
9
+ import android.os.Build
10
+
11
+ /**
12
+ * A `PhoneAccount.CAPABILITY_SELF_MANAGED` connection (see
13
+ * `SinchTelecomManager`) gets no system-drawn incoming-call UI — Android only
14
+ * tracks its call/audio-focus state. Per Android's own docs for self-managed
15
+ * ConnectionServices, the app must post its own high-priority notification
16
+ * with a full-screen intent so the call is visible (and answerable) while
17
+ * backgrounded or the device is locked — Sinch's own Android guide does the
18
+ * same thing manually rather than relying on the SDK for it.
19
+ *
20
+ * Content is configurable via `configure()` (see `SinchCallingModule`'s
21
+ * `configureIncomingCallNotification`) and persisted to `SharedPreferences`
22
+ * rather than kept in memory — a call can arrive and need to show this
23
+ * before JS has started again (e.g. the process was killed and only woken
24
+ * up to relay the push), so the config must survive that with no JS involved.
25
+ */
26
+ internal object SinchIncomingCallNotification {
27
+ private const val CHANNEL_ID = "sinch_incoming_calls"
28
+ internal const val ACTION_ANSWER = "com.sinchcalling.action.ANSWER_CALL"
29
+ internal const val ACTION_DECLINE = "com.sinchcalling.action.DECLINE_CALL"
30
+
31
+ private const val PREFS_NAME = "sinch_calling_incoming_call_notification"
32
+ private const val PREF_ENABLED = "enabled"
33
+ private const val PREF_TITLE = "title"
34
+ private const val PREF_ANSWER_LABEL = "answerLabel"
35
+ private const val PREF_DECLINE_LABEL = "declineLabel"
36
+ private const val PREF_SMALL_ICON_NAME = "smallIconName"
37
+
38
+ private const val DEFAULT_TITLE = "Incoming call"
39
+ private const val DEFAULT_ANSWER_LABEL = "Answer"
40
+ private const val DEFAULT_DECLINE_LABEL = "Decline"
41
+
42
+ private data class Config(
43
+ val enabled: Boolean,
44
+ val title: String,
45
+ val answerLabel: String,
46
+ val declineLabel: String,
47
+ val smallIconName: String?
48
+ )
49
+
50
+ private fun prefs(context: Context) =
51
+ context.applicationContext.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
52
+
53
+ // `null` for a given param leaves that setting unchanged — lets a consumer
54
+ // call e.g. `configureIncomingCallNotification({ enabled: false })` without
55
+ // clobbering a title/labels they configured earlier.
56
+ fun configure(
57
+ context: Context,
58
+ enabled: Boolean?,
59
+ title: String?,
60
+ answerLabel: String?,
61
+ declineLabel: String?,
62
+ smallIconName: String?
63
+ ) {
64
+ prefs(context).edit().apply {
65
+ enabled?.let { putBoolean(PREF_ENABLED, it) }
66
+ title?.let { putString(PREF_TITLE, it) }
67
+ answerLabel?.let { putString(PREF_ANSWER_LABEL, it) }
68
+ declineLabel?.let { putString(PREF_DECLINE_LABEL, it) }
69
+ smallIconName?.let { putString(PREF_SMALL_ICON_NAME, it) }
70
+ }.apply()
71
+ }
72
+
73
+ private fun readConfig(context: Context): Config {
74
+ val prefs = prefs(context)
75
+ return Config(
76
+ enabled = prefs.getBoolean(PREF_ENABLED, true),
77
+ title = prefs.getString(PREF_TITLE, DEFAULT_TITLE) ?: DEFAULT_TITLE,
78
+ answerLabel = prefs.getString(PREF_ANSWER_LABEL, DEFAULT_ANSWER_LABEL) ?: DEFAULT_ANSWER_LABEL,
79
+ declineLabel = prefs.getString(PREF_DECLINE_LABEL, DEFAULT_DECLINE_LABEL) ?: DEFAULT_DECLINE_LABEL,
80
+ smallIconName = prefs.getString(PREF_SMALL_ICON_NAME, null)
81
+ )
82
+ }
83
+
84
+ // Falls back to the host app's launcher icon if no override was
85
+ // configured, or the configured drawable name doesn't resolve.
86
+ private fun resolveSmallIcon(context: Context, iconName: String?): Int {
87
+ if (!iconName.isNullOrBlank()) {
88
+ val resId = context.resources.getIdentifier(iconName, "drawable", context.packageName)
89
+ if (resId != 0) return resId
90
+ }
91
+ return context.applicationInfo.icon
92
+ }
93
+
94
+ private fun notificationId(callId: String): Int = callId.hashCode()
95
+
96
+ private fun ensureChannel(context: Context) {
97
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return
98
+ val manager = context.getSystemService(NotificationManager::class.java) ?: return
99
+ if (manager.getNotificationChannel(CHANNEL_ID) != null) return
100
+ val channel = NotificationChannel(
101
+ CHANNEL_ID,
102
+ "Incoming calls",
103
+ NotificationManager.IMPORTANCE_HIGH
104
+ ).apply {
105
+ description = "Incoming voice calls"
106
+ setBypassDnd(true)
107
+ enableVibration(true)
108
+ lockscreenVisibility = Notification.VISIBILITY_PUBLIC
109
+ }
110
+ manager.createNotificationChannel(channel)
111
+ }
112
+
113
+ private fun actionPendingIntent(context: Context, action: String, callId: String): PendingIntent {
114
+ val intent = Intent(context, SinchCallActionReceiver::class.java).apply {
115
+ this.action = action
116
+ putExtra(SinchTelecomManager.EXTRA_CALL_ID, callId)
117
+ }
118
+ return PendingIntent.getBroadcast(
119
+ context,
120
+ notificationId(callId),
121
+ intent,
122
+ PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
123
+ )
124
+ }
125
+
126
+ // `null` if the host app has no launcher activity (shouldn't happen) —
127
+ // callers fall back to a heads-up-only notification (no tap/full-screen action).
128
+ private fun launchPendingIntent(context: Context, callId: String): PendingIntent? {
129
+ val launchIntent = context.packageManager.getLaunchIntentForPackage(context.packageName)
130
+ ?: return null
131
+ launchIntent.apply {
132
+ addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
133
+ putExtra(SinchTelecomManager.EXTRA_CALL_ID, callId)
134
+ }
135
+ return PendingIntent.getActivity(
136
+ context,
137
+ notificationId(callId),
138
+ launchIntent,
139
+ PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
140
+ )
141
+ }
142
+
143
+ // Re-showing with the same notification id (derived from `callId`) replaces
144
+ // the existing notification in place — used both for the initial ring and
145
+ // to refresh the caller name once a caller-intel lookup resolves.
146
+ fun show(context: Context, callId: String, displayName: String) {
147
+ val appContext = context.applicationContext
148
+ val config = readConfig(appContext)
149
+ if (!config.enabled) return
150
+ ensureChannel(appContext)
151
+
152
+ val builder = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
153
+ Notification.Builder(appContext, CHANNEL_ID)
154
+ } else {
155
+ @Suppress("DEPRECATION")
156
+ Notification.Builder(appContext)
157
+ }
158
+
159
+ builder
160
+ .setSmallIcon(resolveSmallIcon(appContext, config.smallIconName))
161
+ .setContentTitle(config.title)
162
+ .setContentText(displayName.ifBlank { "Unknown" })
163
+ .setCategory(Notification.CATEGORY_CALL)
164
+ .setPriority(Notification.PRIORITY_MAX)
165
+ .setOngoing(true)
166
+ .setAutoCancel(false)
167
+ .addAction(0, config.declineLabel, actionPendingIntent(appContext, ACTION_DECLINE, callId))
168
+ .addAction(0, config.answerLabel, actionPendingIntent(appContext, ACTION_ANSWER, callId))
169
+
170
+ launchPendingIntent(appContext, callId)?.let { launchIntent ->
171
+ builder.setFullScreenIntent(launchIntent, true)
172
+ builder.setContentIntent(launchIntent)
173
+ }
174
+
175
+ val manager = appContext.getSystemService(NotificationManager::class.java) ?: return
176
+ manager.notify(notificationId(callId), builder.build())
177
+ }
178
+
179
+ fun cancel(context: Context, callId: String) {
180
+ val manager = context.applicationContext.getSystemService(NotificationManager::class.java) ?: return
181
+ manager.cancel(notificationId(callId))
182
+ }
183
+ }
@@ -29,6 +29,10 @@ object SinchTelecomManager {
29
29
 
30
30
  private val connections = mutableMapOf<String, SinchConnection>()
31
31
  private val externallyReportedCallIds = mutableSetOf<String>()
32
+ // Set once from `registerPhoneAccount` (always called first, from
33
+ // `SinchCallManager`'s constructor) — reused by the call-lifecycle methods
34
+ // below so they don't all need a `Context` param just to cancel a notification.
35
+ private var appContext: Context? = null
32
36
 
33
37
  fun phoneAccountHandle(context: Context): PhoneAccountHandle {
34
38
  val componentName = ComponentName(context, SinchConnectionService::class.java)
@@ -36,6 +40,7 @@ object SinchTelecomManager {
36
40
  }
37
41
 
38
42
  fun registerPhoneAccount(context: Context) {
43
+ appContext = context.applicationContext
39
44
  val telecomManager = context.getSystemService(TelecomManager::class.java) ?: return
40
45
  val account = PhoneAccount.builder(phoneAccountHandle(context), "SinchCalling")
41
46
  .setCapabilities(PhoneAccount.CAPABILITY_SELF_MANAGED)
@@ -50,6 +55,20 @@ object SinchTelecomManager {
50
55
  putString(EXTRA_REMOTE_USER_ID, remoteUserId)
51
56
  }
52
57
  telecomManager.addNewIncomingCall(phoneAccountHandle(context), extras)
58
+ SinchIncomingCallNotification.show(context, callId, remoteUserId)
59
+ }
60
+
61
+ // Answer/Decline tapped on our own incoming-call notification (see
62
+ // `SinchIncomingCallNotification`/`SinchCallActionReceiver`) — calling
63
+ // these `Connection` callbacks directly (rather than only ever receiving
64
+ // them from the framework) mirrors what the OS would do on our behalf if a
65
+ // Bluetooth headset or Android Auto button were pressed instead.
66
+ fun answerCall(callId: String) {
67
+ connections[callId]?.onAnswer()
68
+ }
69
+
70
+ fun declineCall(callId: String) {
71
+ connections[callId]?.onReject()
53
72
  }
54
73
 
55
74
  // A call the consumer app decided to show a system call UI for (a custom
@@ -75,16 +94,23 @@ object SinchTelecomManager {
75
94
  connection.callId = newCallId
76
95
  connections[newCallId] = connection
77
96
  externallyReportedCallIds.remove(oldCallId)
97
+ // The ringing notification was shown keyed by `oldCallId` — from here on
98
+ // `reportCallActive`/`reportCallEnded` only know about `newCallId`, so it
99
+ // would otherwise never get cancelled.
100
+ appContext?.let { SinchIncomingCallNotification.cancel(it, oldCallId) }
78
101
  }
79
102
 
80
103
  // Overrides the caller name shown on the system call UI (e.g. once a
81
- // caller-ID lookup resolves).
104
+ // caller-ID lookup resolves) — and on our own notification, so the rep
105
+ // doesn't keep seeing the raw phone number once it's resolved.
82
106
  fun updateCallerDisplayName(callId: String, displayName: String) {
83
107
  connections[callId]?.setCallerDisplayName(displayName, TelecomManager.PRESENTATION_ALLOWED)
108
+ appContext?.let { SinchIncomingCallNotification.show(it, callId, displayName) }
84
109
  }
85
110
 
86
111
  fun reportCallActive(callId: String) {
87
112
  connections[callId]?.setActive()
113
+ appContext?.let { SinchIncomingCallNotification.cancel(it, callId) }
88
114
  }
89
115
 
90
116
  fun reportCallEnded(callId: String) {
@@ -94,6 +120,7 @@ object SinchTelecomManager {
94
120
  }
95
121
  connections.remove(callId)
96
122
  externallyReportedCallIds.remove(callId)
123
+ appContext?.let { SinchIncomingCallNotification.cancel(it, callId) }
97
124
  }
98
125
 
99
126
  internal fun registerConnection(callId: String, connection: SinchConnection) {
@@ -102,5 +129,6 @@ object SinchTelecomManager {
102
129
 
103
130
  internal fun unregisterConnection(callId: String) {
104
131
  connections.remove(callId)
132
+ appContext?.let { SinchIncomingCallNotification.cancel(it, callId) }
105
133
  }
106
134
  }
@@ -149,6 +149,11 @@ static void SinchCallingEnsureSharedManagers(void)
149
149
  [_callKitManager updateCallerDisplayName:callId displayName:displayName];
150
150
  }
151
151
 
152
+ - (void)configureIncomingCallNotification:(NSDictionary *)config
153
+ {
154
+ // Android only — iOS uses CallKit's own system UI, nothing to customize here.
155
+ }
156
+
152
157
  - (void)answerCall:(NSString *)callId
153
158
  {
154
159
  [_callManager answerCall:callId];
@@ -1 +1 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSinchCalling.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;AAwKpE,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;AAmLpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,cAAc,CAAC","ignoreList":[]}
@@ -170,6 +170,18 @@ class SinchCalling {
170
170
  NativeSinchCalling.updateIncomingCallDisplayName(callId, displayName);
171
171
  }
172
172
 
173
+ /**
174
+ * Android only. Customizes — or disables — the incoming-call notification
175
+ * that self-managed Telecom connections require on Android — title,
176
+ * Answer/Decline labels, icon. Persisted natively, so it applies even to a
177
+ * call that arrives before JS has started again (e.g. the process was
178
+ * killed and only woken up to relay the incoming-call push) — call this
179
+ * once during setup, before any call can ring. No-op on iOS.
180
+ */
181
+ configureIncomingCallNotification(config) {
182
+ NativeSinchCalling.configureIncomingCallNotification(config);
183
+ }
184
+
173
185
  /** iOS only: hex-encoded PushKit VoIP token, issued on start and on rotation. */
174
186
  onVoipPushTokenUpdated(listener) {
175
187
  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","onVoipPushTokenUpdated","onIncomingCallUIShown","onCallUIAnswered","onCallUIDeclined","onIncomingCallUICancelled"],"sourceRoot":"../../src","sources":["SinchCalling.ts"],"mappings":";;AACA,OAAOA,kBAAkB,MAUlB,yBAAsB;AAM7B,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,C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E,qBAAqB,CAAC1C,QAAQ,CAAC;EAC3D;;EAEA;EACA2C,gBAAgBA,CACd3C,QAA8C,EAC3B;IACnB,OAAOtB,kBAAkB,CAACiE,gBAAgB,CAAC3C,QAAQ,CAAC;EACtD;;EAEA;EACA4C,gBAAgBA,CACd5C,QAA8C,EAC3B;IACnB,OAAOtB,kBAAkB,CAACkE,gBAAgB,CAAC5C,QAAQ,CAAC;EACtD;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE6C,yBAAyBA,CACvB7C,QAAuD,EACpC;IACnB,OAAOtB,kBAAkB,CAACmE,yBAAyB,CAAC7C,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","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,kB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AE0B,WAAW,CAAC;EACvE;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,iCAAiCA,CAC/B3D,MAAsC,EAChC;IACNJ,kBAAkB,CAAC+D,iCAAiC,CAAC3D,MAAM,CAAC;EAC9D;;EAEA;EACA4D,sBAAsBA,CACpB1C,QAA6C,EAC1B;IACnB,OAAOtB,kBAAkB,CAACgE,sBAAsB,CAAC1C,QAAQ,CAAC;EAC5D;;EAEA;AACF;AACA;AACA;AACA;EACE2C,qBAAqBA,CACnB3C,QAA8C,EAC3B;IACnB,OAAOtB,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":[]}
@@ -54,6 +54,7 @@ export interface Spec extends TurboModule {
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
+ configureIncomingCallNotification(config: Object): void;
57
58
  onClientStarted: CodegenTypes.EventEmitter<void>;
58
59
  onClientStartFailed: CodegenTypes.EventEmitter<ClientStartFailedEvent>;
59
60
  onRegistrationCredentialsRequired: CodegenTypes.EventEmitter<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeSinchCalling.d.ts","sourceRoot":"","sources":["../../../src/NativeSinchCalling.ts"],"names":[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D,6BAA6B,EAAE,YAAY,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;IAKjF,sBAAsB,EAAE,YAAY,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAMtE,qBAAqB,EAAE,YAAY,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;IAOtE,yBAAyB,EAAE,YAAY,CAAC,YAAY,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"}
@@ -1,6 +1,26 @@
1
1
  import type { EventSubscription } from 'react-native';
2
2
  import { type CallEndedEvent, type CallEvent, type ClientStartFailedEvent, type IncomingCallEvent, type CallUIAnsweredEvent, type CallUIDeclinedEvent, type IncomingCallUIEvent, type IncomingCallUICancelledEvent, type VoipPushTokenEvent } from './NativeSinchCalling';
3
3
  import type { RegistrationCredentialsProvider, SinchClientConfig } from './types';
4
+ export interface IncomingCallNotificationConfig {
5
+ /**
6
+ * Set to `false` to opt out of the notification entirely — e.g. if you
7
+ * already have your own incoming-call UI solution. Defaults to `true`.
8
+ * Android only; ignored on iOS (which uses CallKit's own system UI).
9
+ */
10
+ enabled?: boolean;
11
+ /** Defaults to "Incoming call". */
12
+ title?: string;
13
+ /** Defaults to "Answer". */
14
+ answerLabel?: string;
15
+ /** Defaults to "Decline". */
16
+ declineLabel?: string;
17
+ /**
18
+ * Name of a drawable resource in your own app (e.g. "ic_call_notification"),
19
+ * resolved via `Resources.getIdentifier`. Falls back to your app's launcher
20
+ * icon if omitted or not found.
21
+ */
22
+ smallIconName?: string;
23
+ }
4
24
  declare class SinchCalling {
5
25
  private credentialsProviderSubscription;
6
26
  configure(config: SinchClientConfig): void;
@@ -90,6 +110,15 @@ declare class SinchCalling {
90
110
  dismissCallUI(callId: string): void;
91
111
  /** Overrides the caller name shown on the system call UI (e.g. after a caller-ID lookup resolves). */
92
112
  updateIncomingCallDisplayName(callId: string, displayName: string): void;
113
+ /**
114
+ * Android only. Customizes — or disables — the incoming-call notification
115
+ * that self-managed Telecom connections require on Android — title,
116
+ * Answer/Decline labels, icon. Persisted natively, so it applies even to a
117
+ * call that arrives before JS has started again (e.g. the process was
118
+ * killed and only woken up to relay the incoming-call push) — call this
119
+ * once during setup, before any call can ring. No-op on iOS.
120
+ */
121
+ configureIncomingCallNotification(config: IncomingCallNotificationConfig): void;
93
122
  /** iOS only: hex-encoded PushKit VoIP token, issued on start and on rotation. */
94
123
  onVoipPushTokenUpdated(listener: (event: VoipPushTokenEvent) => void): EventSubscription;
95
124
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SinchCalling.d.ts","sourceRoot":"","sources":["../../../src/SinchCalling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAA2B,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,+BAA+B,EAC/B,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,cAAM,YAAY;IAChB,OAAO,CAAC,+BAA+B,CAAkC;IAEzE,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAQ1C,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ;;;;OAIG;IACH,kCAAkC,CAChC,QAAQ,EAAE,+BAA+B,GACxC,IAAI;IAeP,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,iBAAiB;IAIxD,mBAAmB,CACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAA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6B,CAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,GAChD,iBAAiB;IAIpB;;;;OAIG;IACH,yBAAyB,CACvB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,MAAM;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,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"}
@@ -1,4 +1,5 @@
1
1
  export { default as SinchCalling } from './SinchCalling';
2
+ export type { IncomingCallNotificationConfig } from './SinchCalling';
2
3
  export type { RegistrationCredentialsProvider, SinchClientConfig, } from './types';
3
4
  export type { CallEndedEvent, CallEvent, ClientStartFailedEvent, IncomingCallEvent, IncomingCallUICancelledEvent, } from './NativeSinchCalling';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EACV,+BAA+B,EAC/B,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,cAAc,EACd,SAAS,EACT,sBAAsB,EACtB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AACrE,YAAY,EACV,+BAA+B,EAC/B,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,cAAc,EACd,SAAS,EACT,sBAAsB,EACtB,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-sinch-calling",
3
- "version": "0.6.2",
3
+ "version": "0.7.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",
@@ -128,6 +128,17 @@ export interface Spec extends TurboModule {
128
128
  // reported as the handle.
129
129
  updateIncomingCallDisplayName(callId: string, displayName: string): void;
130
130
 
131
+ // Android only. Customizes — or disables — the incoming-call notification
132
+ // that self-managed Telecom connections require on Android (see
133
+ // `SinchIncomingCallNotification`); no-op on iOS, which uses CallKit's own
134
+ // system UI instead. Persisted natively (SharedPreferences), so it still
135
+ // applies to a call that arrives before JS has started again — e.g. the
136
+ // process was killed and only woken up to relay the incoming-call push.
137
+ // Call once during setup, before any call can ring. Shape (all fields
138
+ // optional): `{ enabled?, title?, answerLabel?, declineLabel?, smallIconName? }`
139
+ // — see `IncomingCallNotificationConfig` in `SinchCalling.ts`.
140
+ configureIncomingCallNotification(config: Object): void;
141
+
131
142
  onClientStarted: CodegenTypes.EventEmitter<void>;
132
143
  onClientStartFailed: CodegenTypes.EventEmitter<ClientStartFailedEvent>;
133
144
  onRegistrationCredentialsRequired: CodegenTypes.EventEmitter<void>;
@@ -15,6 +15,27 @@ import type {
15
15
  SinchClientConfig,
16
16
  } from './types';
17
17
 
18
+ export interface IncomingCallNotificationConfig {
19
+ /**
20
+ * Set to `false` to opt out of the notification entirely — e.g. if you
21
+ * already have your own incoming-call UI solution. Defaults to `true`.
22
+ * Android only; ignored on iOS (which uses CallKit's own system UI).
23
+ */
24
+ enabled?: boolean;
25
+ /** Defaults to "Incoming call". */
26
+ title?: string;
27
+ /** Defaults to "Answer". */
28
+ answerLabel?: string;
29
+ /** Defaults to "Decline". */
30
+ declineLabel?: string;
31
+ /**
32
+ * Name of a drawable resource in your own app (e.g. "ic_call_notification"),
33
+ * resolved via `Resources.getIdentifier`. Falls back to your app's launcher
34
+ * icon if omitted or not found.
35
+ */
36
+ smallIconName?: string;
37
+ }
38
+
18
39
  class SinchCalling {
19
40
  private credentialsProviderSubscription: EventSubscription | null = null;
20
41
 
@@ -223,6 +244,20 @@ class SinchCalling {
223
244
  NativeSinchCalling.updateIncomingCallDisplayName(callId, displayName);
224
245
  }
225
246
 
247
+ /**
248
+ * Android only. Customizes — or disables — the incoming-call notification
249
+ * that self-managed Telecom connections require on Android — title,
250
+ * Answer/Decline labels, icon. Persisted natively, so it applies even to a
251
+ * call that arrives before JS has started again (e.g. the process was
252
+ * killed and only woken up to relay the incoming-call push) — call this
253
+ * once during setup, before any call can ring. No-op on iOS.
254
+ */
255
+ configureIncomingCallNotification(
256
+ config: IncomingCallNotificationConfig
257
+ ): void {
258
+ NativeSinchCalling.configureIncomingCallNotification(config);
259
+ }
260
+
226
261
  /** iOS only: hex-encoded PushKit VoIP token, issued on start and on rotation. */
227
262
  onVoipPushTokenUpdated(
228
263
  listener: (event: VoipPushTokenEvent) => void
package/src/index.tsx CHANGED
@@ -1,4 +1,5 @@
1
1
  export { default as SinchCalling } from './SinchCalling';
2
+ export type { IncomingCallNotificationConfig } from './SinchCalling';
2
3
  export type {
3
4
  RegistrationCredentialsProvider,
4
5
  SinchClientConfig,