react-native-sinch-calling 0.7.1 → 0.9.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 +7 -0
- package/README.md +32 -3
- package/android/src/main/AndroidManifest.xml +12 -0
- package/android/src/main/java/com/sinchcalling/SinchCallManager.kt +12 -15
- package/android/src/main/java/com/sinchcalling/SinchCallingBootstrap.kt +30 -0
- package/android/src/main/java/com/sinchcalling/SinchCallingModule.kt +11 -2
- package/android/src/main/java/com/sinchcalling/telecom/SinchCallForegroundService.kt +64 -0
- package/android/src/main/java/com/sinchcalling/telecom/SinchFullScreenIntentPermission.kt +40 -0
- package/android/src/main/java/com/sinchcalling/telecom/SinchIncomingCallNotification.kt +137 -1
- package/android/src/main/java/com/sinchcalling/telecom/SinchTelecomManager.kt +57 -2
- package/ios/SinchCalling.mm +16 -1
- package/lib/module/NativeSinchCalling.js.map +1 -1
- package/lib/module/SinchCalling.js +30 -2
- package/lib/module/SinchCalling.js.map +1 -1
- package/lib/typescript/src/NativeSinchCalling.d.ts +3 -1
- package/lib/typescript/src/NativeSinchCalling.d.ts.map +1 -1
- package/lib/typescript/src/SinchCalling.d.ts +23 -1
- package/lib/typescript/src/SinchCalling.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeSinchCalling.ts +26 -1
- package/src/SinchCalling.ts +38 -2
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` (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.
|
|
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,13 @@ 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
|
-
|
|
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
|
|
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.
|
|
203
|
+
SinchCalling.configureCustomCancelCallPush('type', 'call_cancelled', 'reason');
|
|
199
204
|
|
|
200
205
|
// Fires once a cancel push has ended the system call UI natively — clean up
|
|
201
206
|
// any app-side state keyed by `callId` (a pending caller-ID lookup, etc.).
|
|
@@ -252,6 +257,28 @@ SinchCalling.configureIncomingCallNotification({ enabled: false });
|
|
|
252
257
|
|
|
253
258
|
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
259
|
|
|
260
|
+
### Android: keeping the call's microphone alive in the background
|
|
261
|
+
|
|
262
|
+
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.
|
|
263
|
+
|
|
264
|
+
### Android: the full-screen-intent permission can be silently revoked
|
|
265
|
+
|
|
266
|
+
`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.
|
|
267
|
+
|
|
268
|
+
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:
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
import { SinchCalling } from 'react-native-sinch-calling';
|
|
272
|
+
|
|
273
|
+
if (!SinchCalling.isFullScreenIntentPermissionGranted()) {
|
|
274
|
+
// Show your own explanation first — this opens a system settings screen,
|
|
275
|
+
// which is disruptive without context.
|
|
276
|
+
SinchCalling.requestFullScreenIntentPermission();
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
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.
|
|
281
|
+
|
|
255
282
|
### Retrying after a failure
|
|
256
283
|
|
|
257
284
|
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 +307,14 @@ SinchCalling.onClientStartFailed(({ code }) => {
|
|
|
280
307
|
| `enablePushNotifications(useProductionAps)` | iOS | No-op on Android |
|
|
281
308
|
| `relayRemotePushNotification(payload)` | Android | No-op on iOS |
|
|
282
309
|
| `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) |
|
|
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 |
|
|
284
311
|
| `reportIncomingCallUI(callId, displayName)` | both | Shows a call UI for any reason you decide to |
|
|
285
312
|
| `resolveCallUIToConference(callId, conferenceId, callerId)` → `callId` | both | Turns a shown call UI into a real call |
|
|
286
313
|
| `dismissCallUI(callId)` | both | Cleans up a call UI that couldn't be resolved |
|
|
287
314
|
| `updateIncomingCallDisplayName(callId, displayName)` | both | Overrides the shown caller name |
|
|
288
315
|
| `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 |
|
|
316
|
+
| `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) |
|
|
317
|
+
| `requestFullScreenIntentPermission()` | Android | Opens system settings to re-grant it. No-op on iOS/pre-14 Android |
|
|
289
318
|
|
|
290
319
|
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
320
|
|
|
@@ -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
|
|
@@ -69,10 +69,6 @@ class SinchCallManager(private val context: Context) {
|
|
|
69
69
|
private var pendingRegistration: ClientRegistration? = null
|
|
70
70
|
private var pendingPushConfiguration: PushConfiguration? = null
|
|
71
71
|
private val calls = mutableMapOf<String, Call>()
|
|
72
|
-
private var customPushIdField: String? = null
|
|
73
|
-
private var customPushDisplayField: String? = null
|
|
74
|
-
private var customCancelTypeField: String? = null
|
|
75
|
-
private var customCancelValue: String? = null
|
|
76
72
|
|
|
77
73
|
// Proximity-screen-off during an established earpiece call, same as the
|
|
78
74
|
// system Phone app: on while at least one call is established and the
|
|
@@ -136,10 +132,11 @@ class SinchCallManager(private val context: Context) {
|
|
|
136
132
|
|
|
137
133
|
// Opts into recognizing the consumer app's own backend's incoming-call
|
|
138
134
|
// push payloads. Until called, every payload is relayed straight to
|
|
139
|
-
// Sinch (see `relayRemotePushNotification`).
|
|
135
|
+
// Sinch (see `relayRemotePushNotification`). Delegates to
|
|
136
|
+
// `SinchTelecomManager` — see its header comment for why this state
|
|
137
|
+
// doesn't live here.
|
|
140
138
|
fun configureCustomIncomingCallPush(idField: String, displayField: String) {
|
|
141
|
-
|
|
142
|
-
customPushDisplayField = displayField
|
|
139
|
+
SinchTelecomManager.configureCustomIncomingCallPush(idField, displayField)
|
|
143
140
|
}
|
|
144
141
|
|
|
145
142
|
// Opts into recognizing a cancel/end push shaped like the configured
|
|
@@ -148,24 +145,24 @@ class SinchCallManager(private val context: Context) {
|
|
|
148
145
|
// instead of `"incoming_call"`. Checked before the incoming-call match in
|
|
149
146
|
// `relayRemotePushNotification`, so a payload satisfying both is treated
|
|
150
147
|
// as a cancel.
|
|
151
|
-
fun configureCustomCancelCallPush(typeField: String, cancelValue: String) {
|
|
152
|
-
|
|
153
|
-
customCancelValue = cancelValue
|
|
148
|
+
fun configureCustomCancelCallPush(typeField: String, cancelValue: String, reasonField: String? = null) {
|
|
149
|
+
SinchTelecomManager.configureCustomCancelCallPush(typeField, cancelValue, reasonField)
|
|
154
150
|
}
|
|
155
151
|
|
|
156
152
|
fun relayRemotePushNotification(payload: Map<String, String>) {
|
|
157
|
-
val idField = customPushIdField
|
|
153
|
+
val idField = SinchTelecomManager.customPushIdField
|
|
158
154
|
val callId = idField?.let { payload[it] }
|
|
159
155
|
if (callId != null) {
|
|
160
|
-
val typeField = customCancelTypeField
|
|
161
|
-
val cancelValue = customCancelValue
|
|
156
|
+
val typeField = SinchTelecomManager.customCancelTypeField
|
|
157
|
+
val cancelValue = SinchTelecomManager.customCancelValue
|
|
162
158
|
if (typeField != null && cancelValue != null && payload[typeField] == cancelValue) {
|
|
163
|
-
SinchTelecomManager.
|
|
159
|
+
val reason = SinchTelecomManager.customCancelReasonField?.let { payload[it] }
|
|
160
|
+
SinchTelecomManager.reportCallCancelled(callId, reason)
|
|
164
161
|
listener?.onIncomingCallUICancelled(callId)
|
|
165
162
|
return
|
|
166
163
|
}
|
|
167
164
|
|
|
168
|
-
val displayName = customPushDisplayField?.let { payload[it] } ?: ""
|
|
165
|
+
val displayName = SinchTelecomManager.customPushDisplayField?.let { payload[it] } ?: ""
|
|
169
166
|
reportIncomingCallUI(callId, displayName)
|
|
170
167
|
return
|
|
171
168
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
package com.sinchcalling
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import com.sinchcalling.telecom.SinchTelecomManager
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Mirrors iOS's `SinchCallingBootstrap.eagerlyRegisterForVoipPush` — a
|
|
8
|
+
* plain entry point a consumer app's `Application.onCreate()` can call
|
|
9
|
+
* before React Native (or any Activity) exists.
|
|
10
|
+
*
|
|
11
|
+
* A killed app woken purely by an incoming-call FCM push runs its
|
|
12
|
+
* background handler (e.g. `messaging().setBackgroundMessageHandler` on the
|
|
13
|
+
* JS side) in a process that never mounts the app's React component tree —
|
|
14
|
+
* so a JS-side `useEffect` that would otherwise call
|
|
15
|
+
* `SinchCalling.configureCustomIncomingCallPush(...)` (typically on login,
|
|
16
|
+
* deep inside the navigation tree) never runs there, and
|
|
17
|
+
* `SinchCallManager.relayRemotePushNotification` has no way to recognize
|
|
18
|
+
* the custom incoming/cancel-call push shape. `Application.onCreate()` runs
|
|
19
|
+
* for every process launch — including one spun up solely to handle a
|
|
20
|
+
* background push — so configuring it there guarantees it's set before any
|
|
21
|
+
* push can arrive, matching the iOS bootstrap's guarantee.
|
|
22
|
+
*/
|
|
23
|
+
object SinchCallingBootstrap {
|
|
24
|
+
@JvmStatic
|
|
25
|
+
fun eagerlyConfigureCustomIncomingCallPush(context: Context) {
|
|
26
|
+
SinchTelecomManager.registerPhoneAccount(context.applicationContext)
|
|
27
|
+
SinchTelecomManager.configureCustomIncomingCallPush("callId", "callerNumber")
|
|
28
|
+
SinchTelecomManager.configureCustomCancelCallPush("type", "call_cancelled", "reason")
|
|
29
|
+
}
|
|
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
|
-
|
|
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
|
}
|
|
@@ -34,6 +34,39 @@ object SinchTelecomManager {
|
|
|
34
34
|
// below so they don't all need a `Context` param just to cancel a notification.
|
|
35
35
|
private var appContext: Context? = null
|
|
36
36
|
|
|
37
|
+
// Lives here rather than on `SinchCallManager` so `SinchCallingBootstrap`
|
|
38
|
+
// can configure it before any `SinchCallManager`/TurboModule instance
|
|
39
|
+
// exists — see that class's header comment for why that matters.
|
|
40
|
+
internal var customPushIdField: String? = null
|
|
41
|
+
private set
|
|
42
|
+
internal var customPushDisplayField: String? = null
|
|
43
|
+
private set
|
|
44
|
+
internal var customCancelTypeField: String? = null
|
|
45
|
+
private set
|
|
46
|
+
internal var customCancelValue: String? = null
|
|
47
|
+
private set
|
|
48
|
+
internal var customCancelReasonField: String? = null
|
|
49
|
+
private set
|
|
50
|
+
|
|
51
|
+
// Opts into recognizing the consumer app's own backend's incoming-call
|
|
52
|
+
// push payloads. Until called, every payload is relayed straight to Sinch
|
|
53
|
+
// (see `SinchCallManager.relayRemotePushNotification`).
|
|
54
|
+
fun configureCustomIncomingCallPush(idField: String, displayField: String) {
|
|
55
|
+
customPushIdField = idField
|
|
56
|
+
customPushDisplayField = displayField
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Opts into recognizing a cancel/end push shaped like the configured
|
|
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) {
|
|
65
|
+
customCancelTypeField = typeField
|
|
66
|
+
customCancelValue = cancelValue
|
|
67
|
+
customCancelReasonField = reasonField
|
|
68
|
+
}
|
|
69
|
+
|
|
37
70
|
fun phoneAccountHandle(context: Context): PhoneAccountHandle {
|
|
38
71
|
val componentName = ComponentName(context, SinchConnectionService::class.java)
|
|
39
72
|
return PhoneAccountHandle(componentName, ACCOUNT_ID)
|
|
@@ -110,7 +143,13 @@ object SinchTelecomManager {
|
|
|
110
143
|
|
|
111
144
|
fun reportCallActive(callId: String) {
|
|
112
145
|
connections[callId]?.setActive()
|
|
113
|
-
appContext?.let {
|
|
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
|
+
}
|
|
114
153
|
}
|
|
115
154
|
|
|
116
155
|
fun reportCallEnded(callId: String) {
|
|
@@ -120,7 +159,23 @@ object SinchTelecomManager {
|
|
|
120
159
|
}
|
|
121
160
|
connections.remove(callId)
|
|
122
161
|
externallyReportedCallIds.remove(callId)
|
|
123
|
-
appContext?.let {
|
|
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) }
|
|
124
179
|
}
|
|
125
180
|
|
|
126
181
|
internal fun registerConnection(callId: String, connection: SinchConnection) {
|
package/ios/SinchCalling.mm
CHANGED
|
@@ -115,8 +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
|
+
// `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.
|
|
120
123
|
[_pushManager configureCustomCancelCallPushWithTypeField:typeField cancelValue:cancelValue];
|
|
121
124
|
}
|
|
122
125
|
|
|
@@ -154,6 +157,18 @@ static void SinchCallingEnsureSharedManagers(void)
|
|
|
154
157
|
// Android only — iOS uses CallKit's own system UI, nothing to customize here.
|
|
155
158
|
}
|
|
156
159
|
|
|
160
|
+
- (BOOL)isFullScreenIntentPermissionGranted
|
|
161
|
+
{
|
|
162
|
+
// Android only — this whole permission concept doesn't exist on iOS,
|
|
163
|
+
// which uses CallKit's own system UI (no equivalent revocable permission).
|
|
164
|
+
return YES;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
- (void)requestFullScreenIntentPermission
|
|
168
|
+
{
|
|
169
|
+
// Android only — no-op on iOS, see isFullScreenIntentPermissionGranted.
|
|
170
|
+
}
|
|
171
|
+
|
|
157
172
|
- (void)answerCall:(NSString *)callId
|
|
158
173
|
{
|
|
159
174
|
[_callManager answerCall:callId];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeSinchCalling.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;
|
|
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":[]}
|
|
@@ -130,9 +130,16 @@ 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` (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.
|
|
133
140
|
*/
|
|
134
|
-
configureCustomCancelCallPush(typeField, cancelValue) {
|
|
135
|
-
NativeSinchCalling.configureCustomCancelCallPush(typeField, cancelValue);
|
|
141
|
+
configureCustomCancelCallPush(typeField, cancelValue, reasonField) {
|
|
142
|
+
NativeSinchCalling.configureCustomCancelCallPush(typeField, cancelValue, reasonField);
|
|
136
143
|
}
|
|
137
144
|
|
|
138
145
|
/**
|
|
@@ -182,6 +189,27 @@ class SinchCalling {
|
|
|
182
189
|
NativeSinchCalling.configureIncomingCallNotification(config);
|
|
183
190
|
}
|
|
184
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Android only. Android 14+ can silently auto-revoke
|
|
194
|
+
* `USE_FULL_SCREEN_INTENT`, breaking the lock-screen ring in
|
|
195
|
+
* `configureIncomingCallNotification` with no visible error. Always
|
|
196
|
+
* returns `true` on iOS and pre-14 Android. Check on app launch (or
|
|
197
|
+
* whenever returning to the foreground) and call
|
|
198
|
+
* `requestFullScreenIntentPermission` if this comes back `false`.
|
|
199
|
+
*/
|
|
200
|
+
isFullScreenIntentPermissionGranted() {
|
|
201
|
+
return NativeSinchCalling.isFullScreenIntentPermissionGranted();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Android only. Opens the system settings screen where the user can
|
|
206
|
+
* grant/re-grant `USE_FULL_SCREEN_INTENT`. No-op on iOS and pre-14
|
|
207
|
+
* Android.
|
|
208
|
+
*/
|
|
209
|
+
requestFullScreenIntentPermission() {
|
|
210
|
+
NativeSinchCalling.requestFullScreenIntentPermission();
|
|
211
|
+
}
|
|
212
|
+
|
|
185
213
|
/** iOS only: hex-encoded PushKit VoIP token, issued on start and on rotation. */
|
|
186
214
|
onVoipPushTokenUpdated(listener) {
|
|
187
215
|
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,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,CAACq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EACvD;EAEAmB,iBAAiBA,CAACnB,QAAoC,EAAqB;IACzE,OAAOtB,kBAAkB,CAACyC,iBAAiB,CAACnB,QAAQ,CAAC;EACvD;EAEAoB,WAAWA,CAACpB,QAAyC,EAAqB;IACxE,OAAOtB,kBAAkB,CAAC0C,WAAW,CAACpB,QAAQ,CAAC;EACjD;;EAEA;EACAqB,eAAeA,CAACC,QAAgB,EAAEC,KAAa,EAAQ;IACrD7C,kBAAkB,CAAC2C,eAAe,CAACC,QAAQ,EAAEC,KAAK,CAAC;EACrD;;EAEA;EACAC,uBAAuBA,CAACC,gBAAyB,EAAQ;IACvD/C,kBAAkB,CAAC8C,uBAAuB,CAACC,gBAAgB,CAAC;EAC9D;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,2BAA2BA,CAACC,OAA+B,EAAQ;IACjEjD,kBAAkB,CAACgD,2BAA2B,CAACC,OAAO,CAAC;EACzD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,+BAA+BA,CAACC,OAAe,EAAEC,YAAoB,EAAQ;IAC3EpD,kBAAkB,CAACkD,+BAA+B,CAACC,OAAO,EAAEC,YAAY,CAAC;EAC3E;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,6BAA6BA,
|
|
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,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,mB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D,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;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MtE,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"}
|
|
@@ -89,8 +89,15 @@ declare class SinchCalling {
|
|
|
89
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` (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.
|
|
92
99
|
*/
|
|
93
|
-
configureCustomCancelCallPush(typeField: string, cancelValue: string): void;
|
|
100
|
+
configureCustomCancelCallPush(typeField: string, cancelValue: string, reasonField?: string): void;
|
|
94
101
|
/**
|
|
95
102
|
* Reports a system call UI (CallKit / Telecom) for a call your own app
|
|
96
103
|
* logic decided to show — from a custom push, a Socket.IO event, or
|
|
@@ -119,6 +126,21 @@ declare class SinchCalling {
|
|
|
119
126
|
* once during setup, before any call can ring. No-op on iOS.
|
|
120
127
|
*/
|
|
121
128
|
configureIncomingCallNotification(config: IncomingCallNotificationConfig): void;
|
|
129
|
+
/**
|
|
130
|
+
* Android only. Android 14+ can silently auto-revoke
|
|
131
|
+
* `USE_FULL_SCREEN_INTENT`, breaking the lock-screen ring in
|
|
132
|
+
* `configureIncomingCallNotification` with no visible error. Always
|
|
133
|
+
* returns `true` on iOS and pre-14 Android. Check on app launch (or
|
|
134
|
+
* whenever returning to the foreground) and call
|
|
135
|
+
* `requestFullScreenIntentPermission` if this comes back `false`.
|
|
136
|
+
*/
|
|
137
|
+
isFullScreenIntentPermissionGranted(): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Android only. Opens the system settings screen where the user can
|
|
140
|
+
* grant/re-grant `USE_FULL_SCREEN_INTENT`. No-op on iOS and pre-14
|
|
141
|
+
* Android.
|
|
142
|
+
*/
|
|
143
|
+
requestFullScreenIntentPermission(): void;
|
|
122
144
|
/** iOS only: hex-encoded PushKit VoIP token, issued on start and on rotation. */
|
|
123
145
|
onVoipPushTokenUpdated(listener: (event: VoipPushTokenEvent) => void): EventSubscription;
|
|
124
146
|
/**
|
|
@@ -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,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,cAAM,YAA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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
|
@@ -100,7 +100,19 @@ 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
|
-
|
|
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. 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.
|
|
111
|
+
configureCustomCancelCallPush(
|
|
112
|
+
typeField: string,
|
|
113
|
+
cancelValue: string,
|
|
114
|
+
reasonField?: string
|
|
115
|
+
): void;
|
|
104
116
|
|
|
105
117
|
// Reports a system call UI (CallKit / Telecom) for a call your own app
|
|
106
118
|
// logic decided to show — from a custom push, a Socket.IO event, or
|
|
@@ -139,6 +151,19 @@ export interface Spec extends TurboModule {
|
|
|
139
151
|
// — see `IncomingCallNotificationConfig` in `SinchCalling.ts`.
|
|
140
152
|
configureIncomingCallNotification(config: Object): void;
|
|
141
153
|
|
|
154
|
+
// Android only. Android 14+ auto-revokes `USE_FULL_SCREEN_INTENT` for apps
|
|
155
|
+
// it doesn't recognize as a "calling" app — silently, with no callback —
|
|
156
|
+
// which breaks the lock-screen ring in `SinchIncomingCallNotification`
|
|
157
|
+
// without any visible error. Always true on iOS and pre-14 Android. Check
|
|
158
|
+
// this (e.g. on app launch) and call `requestFullScreenIntentPermission`
|
|
159
|
+
// if it comes back false.
|
|
160
|
+
isFullScreenIntentPermissionGranted(): boolean;
|
|
161
|
+
|
|
162
|
+
// Android only. Opens the system settings screen where the user can
|
|
163
|
+
// grant/re-grant `USE_FULL_SCREEN_INTENT`. No-op on iOS and pre-14
|
|
164
|
+
// Android.
|
|
165
|
+
requestFullScreenIntentPermission(): void;
|
|
166
|
+
|
|
142
167
|
onClientStarted: CodegenTypes.EventEmitter<void>;
|
|
143
168
|
onClientStartFailed: CodegenTypes.EventEmitter<ClientStartFailedEvent>;
|
|
144
169
|
onRegistrationCredentialsRequired: CodegenTypes.EventEmitter<void>;
|
package/src/SinchCalling.ts
CHANGED
|
@@ -192,9 +192,24 @@ 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` (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.
|
|
195
202
|
*/
|
|
196
|
-
configureCustomCancelCallPush(
|
|
197
|
-
|
|
203
|
+
configureCustomCancelCallPush(
|
|
204
|
+
typeField: string,
|
|
205
|
+
cancelValue: string,
|
|
206
|
+
reasonField?: string
|
|
207
|
+
): void {
|
|
208
|
+
NativeSinchCalling.configureCustomCancelCallPush(
|
|
209
|
+
typeField,
|
|
210
|
+
cancelValue,
|
|
211
|
+
reasonField
|
|
212
|
+
);
|
|
198
213
|
}
|
|
199
214
|
|
|
200
215
|
/**
|
|
@@ -258,6 +273,27 @@ class SinchCalling {
|
|
|
258
273
|
NativeSinchCalling.configureIncomingCallNotification(config);
|
|
259
274
|
}
|
|
260
275
|
|
|
276
|
+
/**
|
|
277
|
+
* Android only. Android 14+ can silently auto-revoke
|
|
278
|
+
* `USE_FULL_SCREEN_INTENT`, breaking the lock-screen ring in
|
|
279
|
+
* `configureIncomingCallNotification` with no visible error. Always
|
|
280
|
+
* returns `true` on iOS and pre-14 Android. Check on app launch (or
|
|
281
|
+
* whenever returning to the foreground) and call
|
|
282
|
+
* `requestFullScreenIntentPermission` if this comes back `false`.
|
|
283
|
+
*/
|
|
284
|
+
isFullScreenIntentPermissionGranted(): boolean {
|
|
285
|
+
return NativeSinchCalling.isFullScreenIntentPermissionGranted();
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Android only. Opens the system settings screen where the user can
|
|
290
|
+
* grant/re-grant `USE_FULL_SCREEN_INTENT`. No-op on iOS and pre-14
|
|
291
|
+
* Android.
|
|
292
|
+
*/
|
|
293
|
+
requestFullScreenIntentPermission(): void {
|
|
294
|
+
NativeSinchCalling.requestFullScreenIntentPermission();
|
|
295
|
+
}
|
|
296
|
+
|
|
261
297
|
/** iOS only: hex-encoded PushKit VoIP token, issued on start and on rotation. */
|
|
262
298
|
onVoipPushTokenUpdated(
|
|
263
299
|
listener: (event: VoipPushTokenEvent) => void
|