@stream-io/video-react-native-sdk 1.45.0 → 1.45.2
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 +31 -7
- package/android/build.gradle +7 -1
- package/android/src/main/java/com/streamvideo/reactnative/audio/AudioDeviceManager.kt +110 -58
- package/android/src/main/java/com/streamvideo/reactnative/audio/CommunicationModeKeepAlive.kt +247 -0
- package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +16 -5
- package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +112 -26
- package/android/src/main/java/com/streamvideo/reactnative/util/CallAlivePermissionsHelper.kt +68 -37
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +3 -1
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -1
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +38 -11
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +23 -0
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +37 -55
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +43 -4
- package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +1 -1
- package/dist/commonjs/utils/push/internal/android.js +28 -10
- package/dist/commonjs/utils/push/internal/android.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +3 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -1
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +39 -12
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +23 -0
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/callingx/callingx.js +37 -55
- package/dist/module/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/module/utils/keepCallAliveHeadlessTask.js +41 -3
- package/dist/module/utils/keepCallAliveHeadlessTask.js.map +1 -1
- package/dist/module/utils/push/internal/android.js +28 -10
- package/dist/module/utils/push/internal/android.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts +13 -0
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +1 -2
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -1
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +9 -0
- package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/android.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/expo-config-plugin/dist/withAndroidPermissions.js +1 -1
- package/package.json +6 -6
- package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +13 -6
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +59 -21
- package/src/modules/call-manager/native-module.d.ts +14 -0
- package/src/utils/StreamVideoRN/index.ts +27 -0
- package/src/utils/StreamVideoRN/types.ts +1 -2
- package/src/utils/internal/callingx/callingx.ts +47 -66
- package/src/utils/keepCallAliveHeadlessTask.ts +45 -3
- package/src/utils/push/internal/android.ts +31 -10
- package/src/version.ts +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
package com.streamvideo.reactnative.keepalive
|
|
2
2
|
|
|
3
3
|
import android.Manifest
|
|
4
|
+
import android.app.Notification
|
|
5
|
+
import android.content.Context
|
|
4
6
|
import android.content.Intent
|
|
5
7
|
import android.content.pm.PackageManager
|
|
6
8
|
import android.content.pm.ServiceInfo
|
|
@@ -12,6 +14,7 @@ import androidx.core.content.ContextCompat
|
|
|
12
14
|
import com.facebook.react.HeadlessJsTaskService
|
|
13
15
|
import com.facebook.react.bridge.Arguments
|
|
14
16
|
import com.facebook.react.jstasks.HeadlessJsTaskConfig
|
|
17
|
+
import com.streamvideo.reactnative.util.CallAlivePermissionsHelper
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* Foreground service that runs a React Native HeadlessJS task to keep a call alive.
|
|
@@ -20,12 +23,21 @@ import com.facebook.react.jstasks.HeadlessJsTaskConfig
|
|
|
20
23
|
class StreamCallKeepAliveHeadlessService : HeadlessJsTaskService() {
|
|
21
24
|
|
|
22
25
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
val
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
// Without a call cid there is nothing to keep alive and getTaskConfig() would return null,
|
|
27
|
+
// which leaves the base class with a started service and no task. Stop before going
|
|
28
|
+
// foreground so we neither show an orphan notification nor hold the FGS types.
|
|
29
|
+
val callCid = intent?.getStringExtra(EXTRA_CALL_CID)
|
|
30
|
+
if (intent == null || callCid.isNullOrBlank()) {
|
|
31
|
+
Log.w(TAG, "onStartCommand: missing $EXTRA_CALL_CID extra, stopping service")
|
|
32
|
+
stopSelf(startId)
|
|
33
|
+
return START_NOT_STICKY
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
val channelId = intent.getStringExtra(EXTRA_CHANNEL_ID) ?: DEFAULT_CHANNEL_ID
|
|
37
|
+
val channelName = intent.getStringExtra(EXTRA_CHANNEL_NAME) ?: DEFAULT_CHANNEL_NAME
|
|
38
|
+
val title = intent.getStringExtra(EXTRA_TITLE) ?: DEFAULT_TITLE
|
|
39
|
+
val body = intent.getStringExtra(EXTRA_BODY) ?: DEFAULT_BODY
|
|
40
|
+
val smallIconName = intent.getStringExtra(EXTRA_SMALL_ICON_NAME)
|
|
29
41
|
|
|
30
42
|
KeepAliveNotification.ensureChannel(this, channelId, channelName)
|
|
31
43
|
val notification = KeepAliveNotification.buildOngoingNotification(
|
|
@@ -36,10 +48,32 @@ class StreamCallKeepAliveHeadlessService : HeadlessJsTaskService() {
|
|
|
36
48
|
smallIconName = smallIconName
|
|
37
49
|
)
|
|
38
50
|
|
|
39
|
-
startForegroundCompat(notification)
|
|
51
|
+
if (!startForegroundCompat(notification)) {
|
|
52
|
+
// We never entered the foreground. Stop immediately: the system arms a watchdog when
|
|
53
|
+
// startForegroundService() is used and crashes the app with
|
|
54
|
+
// ForegroundServiceDidNotStartInTimeException unless the service either goes foreground
|
|
55
|
+
// or is destroyed. Also pointless to run a JS task with no foreground service behind it.
|
|
56
|
+
stopSelf(startId)
|
|
57
|
+
return START_NOT_STICKY
|
|
58
|
+
}
|
|
40
59
|
|
|
41
60
|
// Ensure HeadlessJS task is started
|
|
42
|
-
return
|
|
61
|
+
return try {
|
|
62
|
+
super.onStartCommand(intent, flags, startId)
|
|
63
|
+
// Deliberately override the base class' START_REDELIVER_INTENT: that would have the
|
|
64
|
+
// system recreate this service (and the process) from the background after a kill,
|
|
65
|
+
// which is a background foreground-service start with while-in-use types
|
|
66
|
+
// (camera/microphone) and is rejected on Android 12+/14+. The call being kept alive
|
|
67
|
+
// does not survive the process anyway, so there is nothing to restart for.
|
|
68
|
+
START_NOT_STICKY
|
|
69
|
+
} catch (e: Exception) {
|
|
70
|
+
// startTask() can throw when the app's Application is not a ReactApplication, when the
|
|
71
|
+
// bridgeless ReactHost is missing, or when the react context was already destroyed.
|
|
72
|
+
// Don't take the app down with us.
|
|
73
|
+
Log.e(TAG, "onStartCommand: Failed to start HeadlessJS task: ${e.message}", e)
|
|
74
|
+
stopSelf(startId)
|
|
75
|
+
START_NOT_STICKY
|
|
76
|
+
}
|
|
43
77
|
}
|
|
44
78
|
|
|
45
79
|
override fun getTaskConfig(intent: Intent?): HeadlessJsTaskConfig? {
|
|
@@ -57,47 +91,100 @@ class StreamCallKeepAliveHeadlessService : HeadlessJsTaskService() {
|
|
|
57
91
|
}
|
|
58
92
|
|
|
59
93
|
override fun onDestroy() {
|
|
60
|
-
super.onDestroy()
|
|
61
94
|
stopForeground(STOP_FOREGROUND_REMOVE)
|
|
95
|
+
super.onDestroy()
|
|
62
96
|
}
|
|
63
97
|
|
|
64
|
-
@RequiresApi(Build.VERSION_CODES.
|
|
98
|
+
@RequiresApi(Build.VERSION_CODES.Q)
|
|
65
99
|
private fun computeForegroundServiceTypes(): Int {
|
|
100
|
+
// From Android 14 a claimed type must also be backed by its FOREGROUND_SERVICE_*
|
|
101
|
+
// permission, and claiming an undeclared type fails the whole startForeground() call. On
|
|
102
|
+
// older platforms those permissions do not exist, so the runtime grant is the only gate and
|
|
103
|
+
// the manifest does not need to be read at all. Read once when it is needed: this runs
|
|
104
|
+
// inside the window the system gives us to enter the foreground.
|
|
105
|
+
val declaredTypePermissions =
|
|
106
|
+
if (CallAlivePermissionsHelper.enforcesTypePermissions()) {
|
|
107
|
+
CallAlivePermissionsHelper.declaredPermissions(this)
|
|
108
|
+
} else {
|
|
109
|
+
null
|
|
110
|
+
}
|
|
111
|
+
|
|
66
112
|
var types = ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK
|
|
67
113
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
114
|
+
if (canUseType(
|
|
115
|
+
Manifest.permission.CAMERA,
|
|
116
|
+
CallAlivePermissionsHelper.PERMISSION_CAMERA,
|
|
117
|
+
declaredTypePermissions
|
|
118
|
+
)
|
|
119
|
+
) {
|
|
71
120
|
types = types or ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA
|
|
72
121
|
}
|
|
73
122
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
123
|
+
if (canUseType(
|
|
124
|
+
Manifest.permission.RECORD_AUDIO,
|
|
125
|
+
CallAlivePermissionsHelper.PERMISSION_MICROPHONE,
|
|
126
|
+
declaredTypePermissions
|
|
127
|
+
)
|
|
128
|
+
) {
|
|
77
129
|
types = types or ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
|
|
78
130
|
}
|
|
79
131
|
|
|
80
132
|
return types
|
|
81
133
|
}
|
|
82
134
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
135
|
+
/**
|
|
136
|
+
* @param declaredTypePermissions the permissions declared in the app manifest, or null when the
|
|
137
|
+
* platform does not require foreground service types to be declared (Android 13 and below).
|
|
138
|
+
*/
|
|
139
|
+
private fun canUseType(
|
|
140
|
+
runtimePermission: String,
|
|
141
|
+
fgsTypePermission: String,
|
|
142
|
+
declaredTypePermissions: Set<String>?
|
|
143
|
+
): Boolean {
|
|
144
|
+
val granted = ContextCompat.checkSelfPermission(this, runtimePermission) ==
|
|
145
|
+
PackageManager.PERMISSION_GRANTED
|
|
146
|
+
if (!granted) {
|
|
147
|
+
return false
|
|
148
|
+
}
|
|
149
|
+
return declaredTypePermissions == null ||
|
|
150
|
+
fgsTypePermission in declaredTypePermissions
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @return true when the service actually entered the foreground.
|
|
155
|
+
*/
|
|
156
|
+
private fun startForegroundCompat(notification: Notification): Boolean {
|
|
157
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
|
158
|
+
val types = computeForegroundServiceTypes()
|
|
159
|
+
if (tryStartForeground(notification, types)) {
|
|
160
|
+
return true
|
|
161
|
+
}
|
|
162
|
+
// The camera/microphone types are rejected on API 34+ when the app hasn't declared the
|
|
163
|
+
// matching FOREGROUND_SERVICE_* permission. mediaPlayback on its own still keeps the JS
|
|
164
|
+
// timers hot, so degrade to it rather than losing the keep-alive entirely.
|
|
165
|
+
val mediaPlaybackOnly = ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK
|
|
166
|
+
return types != mediaPlaybackOnly && tryStartForeground(notification, mediaPlaybackOnly)
|
|
167
|
+
}
|
|
168
|
+
return tryStartForeground(notification, null)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
private fun tryStartForeground(notification: Notification, types: Int?): Boolean {
|
|
172
|
+
return try {
|
|
173
|
+
if (types != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
|
89
174
|
startForeground(NOTIFICATION_ID, notification, types)
|
|
90
175
|
} else {
|
|
91
176
|
startForeground(NOTIFICATION_ID, notification)
|
|
92
177
|
}
|
|
178
|
+
true
|
|
93
179
|
} catch (e: Exception) {
|
|
94
180
|
// Avoid crashing the app if the system rejects starting a foreground service (e.g.
|
|
95
181
|
// background start restrictions, invalid notification/channel, or permission issues).
|
|
96
182
|
Log.e(
|
|
97
183
|
TAG,
|
|
98
|
-
"
|
|
184
|
+
"tryStartForeground: Failed to start foreground service (types=$types): ${e.message}",
|
|
99
185
|
e
|
|
100
186
|
)
|
|
187
|
+
false
|
|
101
188
|
}
|
|
102
189
|
}
|
|
103
190
|
|
|
@@ -121,7 +208,7 @@ class StreamCallKeepAliveHeadlessService : HeadlessJsTaskService() {
|
|
|
121
208
|
private const val DEFAULT_BODY = "Tap to return to the call"
|
|
122
209
|
|
|
123
210
|
fun buildStartIntent(
|
|
124
|
-
context:
|
|
211
|
+
context: Context,
|
|
125
212
|
callCid: String,
|
|
126
213
|
channelId: String,
|
|
127
214
|
channelName: String,
|
|
@@ -141,9 +228,8 @@ class StreamCallKeepAliveHeadlessService : HeadlessJsTaskService() {
|
|
|
141
228
|
}
|
|
142
229
|
}
|
|
143
230
|
|
|
144
|
-
fun buildStopIntent(context:
|
|
231
|
+
fun buildStopIntent(context: Context): Intent {
|
|
145
232
|
return Intent(context, StreamCallKeepAliveHeadlessService::class.java)
|
|
146
233
|
}
|
|
147
234
|
}
|
|
148
235
|
}
|
|
149
|
-
|
package/android/src/main/java/com/streamvideo/reactnative/util/CallAlivePermissionsHelper.kt
CHANGED
|
@@ -1,53 +1,84 @@
|
|
|
1
1
|
package com.streamvideo.reactnative.util
|
|
2
2
|
|
|
3
|
+
import android.content.Context
|
|
3
4
|
import android.content.pm.PackageInfo
|
|
4
5
|
import android.content.pm.PackageManager
|
|
6
|
+
import android.os.Build
|
|
5
7
|
import android.util.Log
|
|
6
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
object CallAlivePermissionsHelper {
|
|
10
11
|
private const val NAME = "StreamVideoReactNative"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
13
|
+
const val PERMISSION_FOREGROUND_SERVICE = "android.permission.FOREGROUND_SERVICE"
|
|
14
|
+
const val PERMISSION_MEDIA_PLAYBACK =
|
|
15
|
+
"android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"
|
|
16
|
+
const val PERMISSION_CAMERA = "android.permission.FOREGROUND_SERVICE_CAMERA"
|
|
17
|
+
const val PERMISSION_MICROPHONE = "android.permission.FOREGROUND_SERVICE_MICROPHONE"
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* From Android 14 the system verifies, at service creation time, that every foreground service
|
|
21
|
+
* type is backed by its matching FOREGROUND_SERVICE_* permission. Below that the types can be
|
|
22
|
+
* used without declaring them.
|
|
23
|
+
*/
|
|
24
|
+
fun enforcesTypePermissions(): Boolean =
|
|
25
|
+
Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The keep-alive service always runs with the `mediaPlayback` type and adds `camera` /
|
|
30
|
+
* `microphone` when those are available, so only FOREGROUND_SERVICE and (on Android 14+)
|
|
31
|
+
* FOREGROUND_SERVICE_MEDIA_PLAYBACK are hard requirements. A missing camera/microphone
|
|
32
|
+
* permission only drops that type - it must not disable the keep-alive altogether, otherwise
|
|
33
|
+
* the app silently loses audio and gets dropped from the call once it is backgrounded.
|
|
34
|
+
*/
|
|
35
|
+
fun hasForegroundServicePermissionsDeclared(context: Context): Boolean {
|
|
36
|
+
val declared = declaredPermissions(context)
|
|
37
|
+
|
|
38
|
+
val required = mutableListOf<String>()
|
|
39
|
+
// FOREGROUND_SERVICE only exists from Android 9, and this SDK supports minSdk 24.
|
|
40
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
|
41
|
+
required.add(PERMISSION_FOREGROUND_SERVICE)
|
|
42
|
+
}
|
|
43
|
+
if (enforcesTypePermissions()) {
|
|
44
|
+
required.add(PERMISSION_MEDIA_PLAYBACK)
|
|
45
|
+
}
|
|
46
|
+
val missingRequired = required.filterNot { declared.contains(it) }
|
|
47
|
+
if (missingRequired.isNotEmpty()) {
|
|
48
|
+
Log.w(
|
|
45
49
|
NAME,
|
|
46
|
-
"
|
|
47
|
-
|
|
50
|
+
"Keep-call-alive is disabled: the app manifest is missing " +
|
|
51
|
+
"${missingRequired.joinToString(", ")}. Without it the call cannot be kept " +
|
|
52
|
+
"alive in the background and the user will be dropped from the call."
|
|
48
53
|
)
|
|
54
|
+
return false
|
|
49
55
|
}
|
|
50
|
-
|
|
56
|
+
|
|
57
|
+
val missingOptional =
|
|
58
|
+
listOf(PERMISSION_CAMERA, PERMISSION_MICROPHONE).filterNot { declared.contains(it) }
|
|
59
|
+
if (missingOptional.isNotEmpty() && enforcesTypePermissions()) {
|
|
60
|
+
Log.w(
|
|
61
|
+
NAME,
|
|
62
|
+
"Keep-call-alive will run without the ${missingOptional.joinToString(", ")} " +
|
|
63
|
+
"foreground service type(s) because the app manifest does not declare them. " +
|
|
64
|
+
"Camera/microphone may be suspended while the app is in the background."
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
return true
|
|
51
68
|
}
|
|
52
69
|
|
|
70
|
+
/** The permissions declared in the app manifest. One PackageManager round trip. */
|
|
71
|
+
fun declaredPermissions(context: Context): Set<String> {
|
|
72
|
+
return try {
|
|
73
|
+
val packageInfo: PackageInfo = context.packageManager.getPackageInfo(
|
|
74
|
+
context.packageName,
|
|
75
|
+
PackageManager.GET_PERMISSIONS
|
|
76
|
+
)
|
|
77
|
+
packageInfo.requestedPermissions?.toSet() ?: emptySet()
|
|
78
|
+
} catch (e: PackageManager.NameNotFoundException) {
|
|
79
|
+
// do nothing, this can never happen actually
|
|
80
|
+
Log.e(NAME, "Package not found: ${context.packageName}", e)
|
|
81
|
+
emptySet()
|
|
82
|
+
}
|
|
83
|
+
}
|
|
53
84
|
}
|
|
@@ -85,7 +85,9 @@ const useCallingExpWithCallingStateEffect = () => {
|
|
|
85
85
|
logger.debug(`useCallingExpWithCallingStateEffect:No active call cid to update callingx: ${activeCallCid} isCallTracked: ${isCallTracked}`);
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
-
callingx.updateDisplay(activeCallCid, createdByUserId ?? callDisplayName, callDisplayName, isIncoming)
|
|
88
|
+
callingx.updateDisplay(activeCallCid, createdByUserId ?? callDisplayName, callDisplayName, isIncoming).catch(error => {
|
|
89
|
+
logger.debug(`useCallingExpWithCallingStateEffect: Error updating display in callingx: ${activeCallCid}`, error);
|
|
90
|
+
});
|
|
89
91
|
}, [activeCallCid, createdByUserId, callDisplayName, isIncoming]);
|
|
90
92
|
|
|
91
93
|
// Sync microphone mute state from app → CallKit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoClient","require","_videoReactBindings","_react","_reactNative","_reactNativeWebrtc","_operators","_callingx","_callingx2","logger","videoLoggerSystem","getLogger","useCallingExpWithCallingStateEffect","useMicrophoneState","useParticipants","useCallMembers","useCallStateHooks","activeCall","useCall","optimisticStatus","microphone","callMembers","participants","activeCallCid","cid","createdByUserId","state","createdBy","id","callCustomDisplayName","custom","display_name","currentUserId","isIncoming","ringing","isCreatedByMe","callDisplayName","useMemo","getCallDisplayName","useEffect","callingx","getCallingxLibIfAvailable","isSetup","shouldMakeCallActive","call","isOngoingCallsEnabled","subscription","callingState$","pipe","filter","callingState","CallingState","JOINED","isCallTracked","take","subscribe","setCurrentCallActive","unsubscribe","debug","endCallWithReason","catch","error","updateDisplay","undefined","setMutedCall","addEventListener","event","callId","muted","isCurrentlyMuted","disable","enable","remove","activateSubscription","tracer","trace","deactivateSubscription","Platform","OS","timeouts","Set","traceRecordingState","trigger","status","isRecording","AudioDeviceModule","isEngineRunning","isMicrophoneMuted","warn","scheduleCheck","delayMs","timeout","setTimeout","delete","add","joinedSubscription","activationSubscription","forEach","clearTimeout","clear","exports"],"sourceRoot":"../../../../src","sources":["hooks/push/useCallingExpWithCallingStateEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAEA,MAAMQ,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CAAC,UAAU,CAAC;;AAEtD;AACA;AACA;AACO,MAAMC,mCAAmC,GAAGA,CAAA,KAAM;EACvD,MAAM;IAAEC,kBAAkB;IAAEC,eAAe;IAAEC;EAAe,CAAC,GAC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AAE;MACxC;IACF;IAEA,MAAM8B,aAAa,GAAGb,QAAQ,CAACa,aAAa,CAAC9B,aAAa,CAAC;IAC3D,IAAI,CAAC8B,aAAa,EAAE;MAClB5C,MAAM,CAACiD,KAAK,CACV,8EAA8EnC,aAAa,mBAAmB8B,aAAa,EAC7H,CAAC;MACD;IACF;IAEAb,QAAQ,
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_videoReactBindings","_react","_reactNative","_reactNativeWebrtc","_operators","_callingx","_callingx2","logger","videoLoggerSystem","getLogger","useCallingExpWithCallingStateEffect","useMicrophoneState","useParticipants","useCallMembers","useCallStateHooks","activeCall","useCall","optimisticStatus","microphone","callMembers","participants","activeCallCid","cid","createdByUserId","state","createdBy","id","callCustomDisplayName","custom","display_name","currentUserId","isIncoming","ringing","isCreatedByMe","callDisplayName","useMemo","getCallDisplayName","useEffect","callingx","getCallingxLibIfAvailable","isSetup","shouldMakeCallActive","call","isOngoingCallsEnabled","subscription","callingState$","pipe","filter","callingState","CallingState","JOINED","isCallTracked","take","subscribe","setCurrentCallActive","unsubscribe","debug","endCallWithReason","catch","error","updateDisplay","undefined","setMutedCall","addEventListener","event","callId","muted","isCurrentlyMuted","disable","enable","remove","activateSubscription","tracer","trace","deactivateSubscription","Platform","OS","timeouts","Set","traceRecordingState","trigger","status","isRecording","AudioDeviceModule","isEngineRunning","isMicrophoneMuted","warn","scheduleCheck","delayMs","timeout","setTimeout","delete","add","joinedSubscription","activationSubscription","forEach","clearTimeout","clear","exports"],"sourceRoot":"../../../../src","sources":["hooks/push/useCallingExpWithCallingStateEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAA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,CAAC,uBAAuB,EAAE,IAAI,CACnD,CAAC;IAED,OAAO,MAAM;MACXM,kBAAkB,CAACtC,WAAW,CAAC,CAAC;MAChCuC,sBAAsB,CAACxB,MAAM,CAAC,CAAC;MAC/BO,QAAQ,CAACkB,OAAO,CAACC,YAAY,CAAC;MAC9BnB,QAAQ,CAACoB,KAAK,CAAC,CAAC;IAClB,CAAC;EACH,CAAC,EAAE,CAAClF,UAAU,CAAC,CAAC;AAClB,CAAC;AAACmF,OAAA,CAAAxF,mCAAA,GAAAA,mCAAA","ignoreList":[]}
|
|
@@ -19,6 +19,10 @@ async function stopForegroundServiceNoThrow() {
|
|
|
19
19
|
logger.warn('Failed to stop keep-call-alive foreground service', e);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @returns true when the native foreground service was asked to start.
|
|
25
|
+
*/
|
|
22
26
|
async function startForegroundService(call_cid) {
|
|
23
27
|
const logger = _videoClient.videoLoggerSystem.getLogger('startForegroundService');
|
|
24
28
|
const isCallAliveConfigured = await (async () => {
|
|
@@ -30,14 +34,14 @@ async function startForegroundService(call_cid) {
|
|
|
30
34
|
}
|
|
31
35
|
})();
|
|
32
36
|
if (!isCallAliveConfigured) {
|
|
33
|
-
logger.
|
|
34
|
-
return;
|
|
37
|
+
logger.warn('KeepCallAlive is not configured, the call will not survive the app going to the ' + 'background: audio publishing stops and the user is eventually dropped from the call. ' + 'Declare android.permission.FOREGROUND_SERVICE and ' + 'android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK in the app manifest (see logcat, ' + 'tag StreamVideoReactNative, for the exact list of missing permissions).');
|
|
38
|
+
return false;
|
|
35
39
|
}
|
|
36
40
|
// Check for notification permission (Android 13+) before starting the service.
|
|
37
41
|
const hasPostNotificationsPermission = Number(_reactNative.Platform.Version) < 33 || (await _reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS));
|
|
38
42
|
if (!hasPostNotificationsPermission) {
|
|
39
43
|
logger.info('Notification permission not granted, can not start foreground service to keep the call alive');
|
|
40
|
-
return;
|
|
44
|
+
return false;
|
|
41
45
|
}
|
|
42
46
|
const videoConfig = _utils.StreamVideoRN.getConfig();
|
|
43
47
|
const foregroundServiceConfig = videoConfig.foregroundService;
|
|
@@ -48,12 +52,25 @@ async function startForegroundService(call_cid) {
|
|
|
48
52
|
// NOTE: we use requestAnimationFrame to ensure that the foreground service is started after all the current UI operations are done
|
|
49
53
|
// this is a workaround for the crash - android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()
|
|
50
54
|
// this crash was reproducible only in some android devices
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
return new Promise(resolve => {
|
|
56
|
+
requestAnimationFrame(async () => {
|
|
57
|
+
// The service declares the camera/microphone foreground service types, which are
|
|
58
|
+
// while-in-use permissions: Android requires startForegroundService() to be called while the
|
|
59
|
+
// app has a visible activity, otherwise the start is rejected. The frame we deferred to can
|
|
60
|
+
// land after the app left the foreground, so re-check before calling native.
|
|
61
|
+
if (_reactNative.AppState.currentState !== 'active') {
|
|
62
|
+
logger.info('App is no longer in the foreground, not starting the keep-call-alive foreground service');
|
|
63
|
+
resolve(false);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
await _reactNative.NativeModules.StreamVideoReactNative.startKeepCallAliveService(call_cid, channel.id, channel.name, notificationTexts.title, notificationTexts.body, smallIconName ?? null);
|
|
68
|
+
resolve(true);
|
|
69
|
+
} catch (e) {
|
|
70
|
+
logger.warn('Failed to start keep-call-alive foreground service', e);
|
|
71
|
+
resolve(false);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
57
74
|
});
|
|
58
75
|
}
|
|
59
76
|
|
|
@@ -114,8 +131,15 @@ const useAndroidKeepCallAliveEffect = () => {
|
|
|
114
131
|
if (foregroundServiceStartedRef.current) {
|
|
115
132
|
return;
|
|
116
133
|
}
|
|
117
|
-
|
|
118
|
-
|
|
134
|
+
try {
|
|
135
|
+
// only mark as started when native actually accepted the start, so that a later render
|
|
136
|
+
// while still joined can retry.
|
|
137
|
+
foregroundServiceStartedRef.current = await startForegroundService(activeCallCid);
|
|
138
|
+
} catch (e) {
|
|
139
|
+
// run() is intentionally not awaited, so anything thrown here would surface as an
|
|
140
|
+
// unhandled rejection. Leave the ref false so a later render can retry.
|
|
141
|
+
_videoClient.videoLoggerSystem.getLogger('useAndroidKeepCallAliveEffect').warn('Failed to start the keep-call-alive foreground service', e);
|
|
142
|
+
}
|
|
119
143
|
};
|
|
120
144
|
|
|
121
145
|
// ensure that app is active before running the function
|
|
@@ -134,6 +158,8 @@ const useAndroidKeepCallAliveEffect = () => {
|
|
|
134
158
|
} else if (isCallEnded) {
|
|
135
159
|
if (foregroundServiceStartedRef.current) {
|
|
136
160
|
_keepCallAliveHeadlessTask.keepCallAliveCallRef.current = undefined;
|
|
161
|
+
// let the headless task resolve so RN unwinds it, then stop the foreground service
|
|
162
|
+
(0, _keepCallAliveHeadlessTask.endKeepCallAliveHeadlessTask)();
|
|
137
163
|
// stop foreground service when the call is not active
|
|
138
164
|
stopForegroundServiceNoThrow();
|
|
139
165
|
foregroundServiceStartedRef.current = false;
|
|
@@ -146,6 +172,7 @@ const useAndroidKeepCallAliveEffect = () => {
|
|
|
146
172
|
// stop foreground service when this effect is unmounted
|
|
147
173
|
if (foregroundServiceStartedRef.current) {
|
|
148
174
|
_keepCallAliveHeadlessTask.keepCallAliveCallRef.current = undefined;
|
|
175
|
+
(0, _keepCallAliveHeadlessTask.endKeepCallAliveHeadlessTask)();
|
|
149
176
|
stopForegroundServiceNoThrow();
|
|
150
177
|
foregroundServiceStartedRef.current = false;
|
|
151
178
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoReactBindings","require","_react","_utils","_reactNative","_videoClient","_keepCallAliveHeadlessTask","_libs","stopForegroundServiceNoThrow","logger","videoLoggerSystem","getLogger","NativeModules","StreamVideoReactNative","stopKeepCallAliveService","e","warn","startForegroundService","call_cid","isCallAliveConfigured","
|
|
1
|
+
{"version":3,"names":["_videoReactBindings","require","_react","_utils","_reactNative","_videoClient","_keepCallAliveHeadlessTask","_libs","stopForegroundServiceNoThrow","logger","videoLoggerSystem","getLogger","NativeModules","StreamVideoReactNative","stopKeepCallAliveService","e","warn","startForegroundService","call_cid","isCallAliveConfigured","hasPostNotificationsPermission","Number","Platform","Version","PermissionsAndroid","check","PERMISSIONS","POST_NOTIFICATIONS","info","videoConfig","StreamVideoRN","getConfig","foregroundServiceConfig","foregroundService","notificationTexts","android","channel","smallIconName","push","smallIcon","Promise","resolve","requestAnimationFrame","AppState","currentState","startKeepCallAliveService","id","name","title","body","useAndroidKeepCallAliveEffect","foregroundServiceStartedRef","useRef","callingxKeepAliveOwnerRef","undefined","call","useCall","keepCallAliveCallRef","current","activeCallCid","cid","useCallCallingState","useCallStateHooks","callingState","isCallJoined","CallingState","JOINED","isRingingCall","ringing","shouldStartForegroundService","useEffect","OS","callingx","getCallingxLibIfAvailable","isCallingxManaged","isSetup","isOngoingCallsEnabled","isCallEnded","IDLE","LEFT","currentOwner","releaseBackgroundTask","catch","owner","acquireBackgroundTask","run","sub","addEventListener","nextAppState","remove","endKeepCallAliveHeadlessTask","exports"],"sourceRoot":"../../../src","sources":["hooks/useAndroidKeepCallAliveEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,0BAAA,GAAAL,OAAA;AAIA,IAAAM,KAAA,GAAAN,OAAA;AAEA,eAAeO,4BAA4BA,CAAA,EAAG;EAC5C,MAAMC,MAAM,GAAGC,8BAAiB,CA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B,CAAC,EAAE,CACDK,aAAa,EACbI,YAAY,EACZM,4BAA4B,EAC5BF,aAAa,CACd,CAAC;EAEF,IAAAG,gBAAS,EAAC,MAAM;IACd,OAAO,MAAM;MACX;MACA,IAAInB,2BAA2B,CAACO,OAAO,EAAE;QACvCD,+CAAoB,CAACC,OAAO,GAAGJ,SAAS;QACxC,IAAAoC,uDAA4B,EAAC,CAAC;QAC9BlF,4BAA4B,CAAC,CAAC;QAC9B2C,2BAA2B,CAACO,OAAO,GAAG,KAAK;MAC7C;MACA;MACA,IAAIL,yBAAyB,CAACK,OAAO,EAAE;QACrC,MAAMyB,KAAK,GAAG9B,yBAAyB,CAACK,OAAO;QAC/CL,yBAAyB,CAACK,OAAO,GAAGJ,SAAS;QAC7C,IAAAmB,+BAAyB,EAAC,CAAC,EACvBQ,qBAAqB,CAACE,KAAK,CAAC,CAC7BD,KAAK,CAAC,MAAM;UACXxE,8BAAiB,CACdC,SAAS,CAAC,+BAA+B,CAAC,CAC1CK,IAAI,CACH,uDAAuD,EACvDmE,KACF,CAAC;QACL,CAAC,CAAC;MACN;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAACQ,OAAA,CAAAzC,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
|
@@ -131,6 +131,29 @@ class StreamVideoRN {
|
|
|
131
131
|
_pushLogoutCallback.default.current = [];
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Android only. Opt out of the Android 11+ communication-mode keep-alive.
|
|
136
|
+
*
|
|
137
|
+
* By default the SDK plays a silent voice-communication track for the duration of a
|
|
138
|
+
* communicator-role call, so Android does not reset `MODE_IN_COMMUNICATION` ~6s after it is
|
|
139
|
+
* set (which breaks audio routing and echo cancellation).
|
|
140
|
+
* See {@link https://issuetracker.google.com/issues/209493718}
|
|
141
|
+
*
|
|
142
|
+
* Call this at app start, alongside {@link setPushConfig} — the native audio manager
|
|
143
|
+
* rejects the change once it has been activated for a call. No-op on iOS and on
|
|
144
|
+
* Android below API 30.
|
|
145
|
+
*/
|
|
146
|
+
static setDisableCommunicationModeWorkaround(disabled) {
|
|
147
|
+
if (_reactNative.Platform.OS !== 'android') {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
_reactNative.NativeModules.StreamInCallManager?.setDisableCommunicationModeWorkaround(disabled);
|
|
152
|
+
} catch (error) {
|
|
153
|
+
_videoClient.videoLoggerSystem.getLogger('StreamVideoRN').warn('setDisableCommunicationModeWorkaround failed', error);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
134
157
|
/**
|
|
135
158
|
* Play native busy tone for call rejection
|
|
136
159
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pushLogoutCallback","_interopRequireDefault","require","_setupIosVoipPushEvents","_setupAndroidPushEvents","_setupCallingExpEvents","_callingx","_reactNative","_videoClient","e","__esModule","default","deepMerge","target","source","result","key","undefined","Array","isArray","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","notificationTexts","title","body","taskToRun","Promise","StreamVideoRN","config","updateConfig","setPushConfig","pushConfig","push","callingx","getCallingxLib","videoLoggerSystem","getLogger","info","JSON","stringify","options","extractCallingExpOptions","setup","Error","setupCallingExpEvents","setupIosVoipPushEvents","setupAndroidPushEvents","getConfig","onPushLogout","callbacks","pushLogoutCallbacks","current","resolve","all","map","callback","then","clearPushLogoutCallbacks","
|
|
1
|
+
{"version":3,"names":["_pushLogoutCallback","_interopRequireDefault","require","_setupIosVoipPushEvents","_setupAndroidPushEvents","_setupCallingExpEvents","_callingx","_reactNative","_videoClient","e","__esModule","default","deepMerge","target","source","result","key","undefined","Array","isArray","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","notificationTexts","title","body","taskToRun","Promise","StreamVideoRN","config","updateConfig","setPushConfig","pushConfig","push","callingx","getCallingxLib","videoLoggerSystem","getLogger","info","JSON","stringify","options","extractCallingExpOptions","setup","Error","setupCallingExpEvents","setupIosVoipPushEvents","setupAndroidPushEvents","getConfig","onPushLogout","callbacks","pushLogoutCallbacks","current","resolve","all","map","callback","then","clearPushLogoutCallbacks","setDisableCommunicationModeWorkaround","disabled","Platform","OS","NativeModules","StreamInCallManager","error","warn","playBusyTone","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware","exports"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAIA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAA4D,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5D;;AAKA;AACA,SAASG,SAASA,CAChBC,MAAS,EACTC,MAAsB,EACnB;EACH,MAAMC,MAAM,GAAG;IAAE,GAAGF;EAAO,CAAC;EAE5B,KAAK,MAAMG,GAAG,IAAIF,MAAM,EAAE;IACxB,IAAIA,MAAM,CAACE,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC7B,IACE,OAAOH,MAAM,CAACE,GAAG,CAAC,KAAK,QAAQ,IAC/BF,MAAM,CAACE,GAAG,CAAC,KAAK,IAAI,IACpB,CAACE,KAAK,CAACC,OAAO,CAACL,MAAM,CAACE,GAAG,CAAC,CAAC,IAC3B,OAAOH,MAAM,CAACG,GAAG,CAAC,KAAK,QAAQ,IAC/BH,MAAM,CAACG,GAAG,CAAC,KAAK,IAAI,IACpB,CAACE,KAAK,CAACC,OAAO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