@stream-io/react-native-callingx 0.1.0-beta.0 → 0.1.0-beta.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/android/bin/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- package/android/bin/src/main/java/io/getstream/rn/callingx/CallService.kt +9 -3
- package/android/bin/src/main/java/io/getstream/rn/callingx/CallingxModule.kt +6 -1
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt +42 -12
- package/android/bin/src/main/java/io/getstream/rn/callingx/repo/CallRepository.kt +1 -1
- package/android/bin/src/main/java/io/getstream/rn/callingx/repo/LegacyCallRepository.kt +7 -2
- package/android/bin/src/main/java/io/getstream/rn/callingx/repo/TelecomCallRepository.kt +3 -9
- package/android/src/main/java/io/getstream/rn/callingx/CallService.kt +9 -3
- package/android/src/main/java/io/getstream/rn/callingx/CallingxModule.kt +6 -1
- package/android/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt +42 -12
- package/android/src/main/java/io/getstream/rn/callingx/repo/CallRepository.kt +1 -1
- package/android/src/main/java/io/getstream/rn/callingx/repo/LegacyCallRepository.kt +8 -2
- package/android/src/main/java/io/getstream/rn/callingx/repo/TelecomCallRepository.kt +3 -9
- package/ios/AudioSessionManager.swift +2 -7
- package/ios/CallingxImpl.swift +21 -9
- package/package.json +3 -3
- package/android/bin/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/bin/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/bin/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/bin/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -3
- package/android/bin/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/drawable_ic_phone_paused_24.xml.flat +0 -0
- package/android/bin/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/drawable_ic_round_call_24.xml.flat +0 -0
- package/android/bin/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/drawable_ic_user.xml.flat +0 -0
- package/android/bin/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
- package/android/bin/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/bin/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/bin/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/stream-io_react-native-callingx_debug.kotlin_module +0 -0
- package/android/bin/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -5
- package/android/bin/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/stream-io_react-native-callingx_debug.kotlin_module +0 -0
- package/android/bin/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/bin/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -4
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.s +0 -1
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/bin/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/bin/build/tmp/kotlin-classes/debug/META-INF/stream-io_react-native-callingx_debug.kotlin_module +0 -0
- package/android/bin/build.gradle +0 -81
- package/android/bin/gradle.properties +0 -5
- package/android/bin/local.properties +0 -8
- package/android/bin/src/main/AndroidManifest.xml +0 -30
- package/android/bin/src/main/java/io/getstream/rn/callingx/CallingxPackage.kt +0 -16
- package/android/bin/src/main/java/io/getstream/rn/callingx/HeadlessTaskManager.kt +0 -164
- package/android/bin/src/main/java/io/getstream/rn/callingx/ResourceUtils.kt +0 -60
- package/android/bin/src/main/java/io/getstream/rn/callingx/Utils.kt +0 -23
- package/android/bin/src/main/java/io/getstream/rn/callingx/model/Call.kt +0 -57
- package/android/bin/src/main/java/io/getstream/rn/callingx/model/CallAction.kt +0 -36
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationChannelsManager.kt +0 -113
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationIntentFactory.kt +0 -105
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverActivity.kt +0 -42
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverService.kt +0 -56
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationsConfig.kt +0 -116
- package/android/bin/src/main/res/drawable/ic_phone_paused_24.xml +0 -11
- package/android/bin/src/main/res/drawable/ic_round_call_24.xml +0 -11
- package/android/bin/src/main/res/drawable/ic_user.xml +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#Wed
|
|
1
|
+
#Wed Feb 04 17:19:56 CET 2026
|
|
2
2
|
io.getstream.rn.callingx.stream-io_react-native-callingx-main-6\:/drawable/ic_phone_paused_24.xml=/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/build/intermediates/packaged_res/debug/packageDebugResources/drawable/ic_phone_paused_24.xml
|
|
3
3
|
io.getstream.rn.callingx.stream-io_react-native-callingx-main-6\:/drawable/ic_round_call_24.xml=/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/build/intermediates/packaged_res/debug/packageDebugResources/drawable/ic_round_call_24.xml
|
|
4
4
|
io.getstream.rn.callingx.stream-io_react-native-callingx-main-6\:/drawable/ic_user.xml=/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/build/intermediates/packaged_res/debug/packageDebugResources/drawable/ic_user.xml
|
|
@@ -241,9 +241,15 @@ class CallService : Service(), CallRepository.Listener {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
override fun onCallRegistered(callId: String) {
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
override fun onCallRegistered(callId: String, incoming: Boolean) {
|
|
245
|
+
if (incoming) {
|
|
246
|
+
sendBroadcastEvent(CallingxModule.CALL_REGISTERED_INCOMING_ACTION) {
|
|
247
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
sendBroadcastEvent(CallingxModule.CALL_REGISTERED_ACTION) {
|
|
251
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
252
|
+
}
|
|
247
253
|
}
|
|
248
254
|
}
|
|
249
255
|
|
|
@@ -42,6 +42,7 @@ class CallingxModule(reactContext: ReactApplicationContext) : NativeCallingxSpec
|
|
|
42
42
|
const val EXTRA_SOURCE = "source"
|
|
43
43
|
|
|
44
44
|
const val CALL_REGISTERED_ACTION = "call_registered"
|
|
45
|
+
const val CALL_REGISTERED_INCOMING_ACTION = "call_registered_incoming"
|
|
45
46
|
const val CALL_ANSWERED_ACTION = "call_answered"
|
|
46
47
|
// const val CALL_DISCONNECTED_ACTION = "call_disconnected"
|
|
47
48
|
const val CALL_INACTIVE_ACTION = "call_inactive"
|
|
@@ -365,7 +366,7 @@ class CallingxModule(reactContext: ReactApplicationContext) : NativeCallingxSpec
|
|
|
365
366
|
if (!isHeadlessTaskRegistered) {
|
|
366
367
|
debugLog(
|
|
367
368
|
TAG,
|
|
368
|
-
"[module] startBackgroundTaskAutomatically: Headless task
|
|
369
|
+
"[module] startBackgroundTaskAutomatically: Headless task is not registered"
|
|
369
370
|
)
|
|
370
371
|
return
|
|
371
372
|
}
|
|
@@ -446,6 +447,7 @@ class CallingxModule(reactContext: ReactApplicationContext) : NativeCallingxSpec
|
|
|
446
447
|
private fun getReceiverFilter(): IntentFilter =
|
|
447
448
|
IntentFilter().apply {
|
|
448
449
|
addAction(CALL_REGISTERED_ACTION)
|
|
450
|
+
addAction(CALL_REGISTERED_INCOMING_ACTION)
|
|
449
451
|
addAction(CALL_ANSWERED_ACTION)
|
|
450
452
|
addAction(CALL_ACTIVE_ACTION)
|
|
451
453
|
addAction(CALL_INACTIVE_ACTION)
|
|
@@ -560,6 +562,9 @@ class CallingxModule(reactContext: ReactApplicationContext) : NativeCallingxSpec
|
|
|
560
562
|
CALL_REGISTERED_ACTION -> {
|
|
561
563
|
sendJSEvent("didReceiveStartCallAction", params)
|
|
562
564
|
}
|
|
565
|
+
CALL_REGISTERED_INCOMING_ACTION -> {
|
|
566
|
+
sendJSEvent("didDisplayIncomingCall", params)
|
|
567
|
+
}
|
|
563
568
|
CALL_ANSWERED_ACTION -> {
|
|
564
569
|
if (intent.hasExtra(EXTRA_SOURCE)) {
|
|
565
570
|
params.putString("source", intent.getStringExtra(EXTRA_SOURCE))
|
package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt
CHANGED
|
@@ -4,6 +4,7 @@ import android.app.Notification
|
|
|
4
4
|
import android.content.Context
|
|
5
5
|
import android.media.Ringtone
|
|
6
6
|
import android.media.RingtoneManager
|
|
7
|
+
import android.net.Uri
|
|
7
8
|
import android.os.Build
|
|
8
9
|
import android.telecom.DisconnectCause
|
|
9
10
|
import android.util.Log
|
|
@@ -44,11 +45,35 @@ class CallNotificationManager(
|
|
|
44
45
|
|
|
45
46
|
private var hasBecameActive = false
|
|
46
47
|
|
|
48
|
+
private var lastPostedSnapshot: NotificationSnapshot? = null
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Snapshot of call state used to detect notification changes.
|
|
52
|
+
* Using a data class ensures immutable comparison and avoids issues
|
|
53
|
+
* with mutable Call.Registered objects.
|
|
54
|
+
*/
|
|
55
|
+
private data class NotificationSnapshot(
|
|
56
|
+
val id: String,
|
|
57
|
+
val isActive: Boolean,
|
|
58
|
+
val isIncoming: Boolean,
|
|
59
|
+
val displayTitle: String?,
|
|
60
|
+
val displaySubtitle: String?,
|
|
61
|
+
val displayName: CharSequence,
|
|
62
|
+
val address: Uri
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
private fun Call.Registered.toSnapshot() = NotificationSnapshot(
|
|
66
|
+
id = id,
|
|
67
|
+
isActive = isActive,
|
|
68
|
+
isIncoming = isIncoming(),
|
|
69
|
+
displayTitle = displayOptions?.getString(CallService.EXTRA_DISPLAY_TITLE),
|
|
70
|
+
displaySubtitle = displayOptions?.getString(CallService.EXTRA_DISPLAY_SUBTITLE),
|
|
71
|
+
displayName = callAttributes.displayName,
|
|
72
|
+
address = callAttributes.address
|
|
73
|
+
)
|
|
74
|
+
|
|
47
75
|
fun createNotification(call: Call.Registered): Notification {
|
|
48
|
-
debugLog(
|
|
49
|
-
TAG,
|
|
50
|
-
"[notifications] createNotification: Creating notification for call ID: ${call.id}"
|
|
51
|
-
)
|
|
76
|
+
debugLog(TAG,"[notifications] createNotification: Creating notification for call ID: ${call.id}")
|
|
52
77
|
|
|
53
78
|
val contentIntent =
|
|
54
79
|
NotificationIntentFactory.getLaunchActivityIntent(
|
|
@@ -90,19 +115,22 @@ class CallNotificationManager(
|
|
|
90
115
|
fun updateCallNotification(call: Call) {
|
|
91
116
|
when (call) {
|
|
92
117
|
Call.None, is Call.Unregistered -> {
|
|
93
|
-
debugLog(
|
|
94
|
-
TAG,
|
|
95
|
-
"[notifications] updateCallNotification: Dismissing notification (call is None or Unregistered)"
|
|
96
|
-
)
|
|
118
|
+
debugLog(TAG, "[notifications] updateCallNotification: Dismissing notification (call is None or Unregistered)")
|
|
97
119
|
notificationManager.cancel(NOTIFICATION_ID)
|
|
120
|
+
lastPostedSnapshot = null
|
|
121
|
+
hasBecameActive = false
|
|
98
122
|
}
|
|
99
123
|
is Call.Registered -> {
|
|
124
|
+
val newSnapshot = call.toSnapshot()
|
|
125
|
+
if (newSnapshot == lastPostedSnapshot) {
|
|
126
|
+
debugLog(TAG, "[notifications] updateCallNotification: Skipping - no state change")
|
|
127
|
+
return
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
lastPostedSnapshot = newSnapshot
|
|
100
131
|
val notification = createNotification(call)
|
|
101
132
|
notificationManager.notify(NOTIFICATION_ID, notification)
|
|
102
|
-
debugLog(
|
|
103
|
-
TAG,
|
|
104
|
-
"[notifications] updateCallNotification: Notification posted successfully"
|
|
105
|
-
)
|
|
133
|
+
debugLog(TAG, "[notifications] updateCallNotification: Notification posted successfully")
|
|
106
134
|
}
|
|
107
135
|
}
|
|
108
136
|
}
|
|
@@ -110,6 +138,7 @@ class CallNotificationManager(
|
|
|
110
138
|
fun cancelNotifications() {
|
|
111
139
|
notificationManager.cancel(NOTIFICATION_ID)
|
|
112
140
|
hasBecameActive = false
|
|
141
|
+
lastPostedSnapshot = null
|
|
113
142
|
}
|
|
114
143
|
|
|
115
144
|
fun startRingtone() {
|
|
@@ -212,4 +241,5 @@ class CallNotificationManager(
|
|
|
212
241
|
.setImportant(true)
|
|
213
242
|
.build()
|
|
214
243
|
}
|
|
244
|
+
|
|
215
245
|
}
|
|
@@ -34,7 +34,7 @@ abstract class CallRepository(protected val context: Context) {
|
|
|
34
34
|
fun onIsCallDisconnected(callId: String?, cause: DisconnectCause, source: EventSource)
|
|
35
35
|
fun onIsCallInactive(callId: String)
|
|
36
36
|
fun onIsCallActive(callId: String)
|
|
37
|
-
fun onCallRegistered(callId: String)
|
|
37
|
+
fun onCallRegistered(callId: String, incoming: Boolean)
|
|
38
38
|
fun onMuteCallChanged(callId: String, isMuted: Boolean)
|
|
39
39
|
fun onCallEndpointChanged(callId: String, endpoint: String)
|
|
40
40
|
}
|
|
@@ -20,12 +20,15 @@ class LegacyCallRepository(context: Context) : CallRepository(context) {
|
|
|
20
20
|
private const val TAG = "[Callingx] LegacyCallRepository"
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
private var observeCallStateJob: Job? = null
|
|
24
|
+
|
|
23
25
|
override fun getTag(): String = TAG
|
|
24
26
|
|
|
25
27
|
override fun setListener(listener: Listener?) {
|
|
26
28
|
this._listener = listener
|
|
27
29
|
// Observe call state changes
|
|
28
|
-
|
|
30
|
+
observeCallStateJob?.cancel()
|
|
31
|
+
observeCallStateJob = scope.launch {
|
|
29
32
|
try {
|
|
30
33
|
currentCall.collect { _listener?.onCallStateChanged(it) }
|
|
31
34
|
} catch (e: Exception) {
|
|
@@ -37,6 +40,8 @@ class LegacyCallRepository(context: Context) : CallRepository(context) {
|
|
|
37
40
|
override fun release() {
|
|
38
41
|
_currentCall.value = Call.None
|
|
39
42
|
|
|
43
|
+
observeCallStateJob?.cancel()
|
|
44
|
+
observeCallStateJob = null
|
|
40
45
|
_listener = null
|
|
41
46
|
|
|
42
47
|
scope.cancel()
|
|
@@ -76,7 +81,7 @@ class LegacyCallRepository(context: Context) : CallRepository(context) {
|
|
|
76
81
|
actionSource = actionSource,
|
|
77
82
|
)
|
|
78
83
|
|
|
79
|
-
_listener?.onCallRegistered(callId)
|
|
84
|
+
_listener?.onCallRegistered(callId, isIncoming)
|
|
80
85
|
|
|
81
86
|
// Process actions without telecom SDK
|
|
82
87
|
scope.launch {
|
|
@@ -199,9 +199,7 @@ class TelecomCallRepository(context: Context) : CallRepository(context) {
|
|
|
199
199
|
.onEach { (previous, current) ->
|
|
200
200
|
when {
|
|
201
201
|
previous is Call.None && current is Call.Registered -> {
|
|
202
|
-
|
|
203
|
-
_listener?.onCallRegistered(current.id)
|
|
204
|
-
}
|
|
202
|
+
_listener?.onCallRegistered(current.id, current.isIncoming())
|
|
205
203
|
}
|
|
206
204
|
previous is Call.Registered && current is Call.Registered -> {
|
|
207
205
|
if (previous.isMuted != current.isMuted) {
|
|
@@ -372,9 +370,7 @@ class TelecomCallRepository(context: Context) : CallRepository(context) {
|
|
|
372
370
|
updateCurrentCall { copy(isActive = true, isOnHold = false) }
|
|
373
371
|
|
|
374
372
|
val call = _currentCall.value
|
|
375
|
-
val source =
|
|
376
|
-
if (isSelfAnswered) EventSource.APP
|
|
377
|
-
else EventSource.SYS
|
|
373
|
+
val source = if (isSelfAnswered) EventSource.APP else EventSource.SYS
|
|
378
374
|
if (call is Call.Registered) {
|
|
379
375
|
_listener?.onIsCallAnswered(call.id, source)
|
|
380
376
|
}
|
|
@@ -388,9 +384,7 @@ class TelecomCallRepository(context: Context) : CallRepository(context) {
|
|
|
388
384
|
TAG,
|
|
389
385
|
"[repository] onIsCallDisconnected: Call disconnected, cause: ${it.reason}, description: ${it.description}"
|
|
390
386
|
)
|
|
391
|
-
val source =
|
|
392
|
-
if (isSelfDisconnected) EventSource.APP
|
|
393
|
-
else EventSource.SYS
|
|
387
|
+
val source = if (isSelfDisconnected) EventSource.APP else EventSource.SYS
|
|
394
388
|
var callId: String? = null
|
|
395
389
|
if (_currentCall.value is Call.Registered) {
|
|
396
390
|
callId = (_currentCall.value as Call.Registered).id
|
|
@@ -241,9 +241,15 @@ class CallService : Service(), CallRepository.Listener {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
override fun onCallRegistered(callId: String) {
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
override fun onCallRegistered(callId: String, incoming: Boolean) {
|
|
245
|
+
if (incoming) {
|
|
246
|
+
sendBroadcastEvent(CallingxModule.CALL_REGISTERED_INCOMING_ACTION) {
|
|
247
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
sendBroadcastEvent(CallingxModule.CALL_REGISTERED_ACTION) {
|
|
251
|
+
putExtra(CallingxModule.EXTRA_CALL_ID, callId)
|
|
252
|
+
}
|
|
247
253
|
}
|
|
248
254
|
}
|
|
249
255
|
|
|
@@ -42,6 +42,7 @@ class CallingxModule(reactContext: ReactApplicationContext) : NativeCallingxSpec
|
|
|
42
42
|
const val EXTRA_SOURCE = "source"
|
|
43
43
|
|
|
44
44
|
const val CALL_REGISTERED_ACTION = "call_registered"
|
|
45
|
+
const val CALL_REGISTERED_INCOMING_ACTION = "call_registered_incoming"
|
|
45
46
|
const val CALL_ANSWERED_ACTION = "call_answered"
|
|
46
47
|
// const val CALL_DISCONNECTED_ACTION = "call_disconnected"
|
|
47
48
|
const val CALL_INACTIVE_ACTION = "call_inactive"
|
|
@@ -365,7 +366,7 @@ class CallingxModule(reactContext: ReactApplicationContext) : NativeCallingxSpec
|
|
|
365
366
|
if (!isHeadlessTaskRegistered) {
|
|
366
367
|
debugLog(
|
|
367
368
|
TAG,
|
|
368
|
-
"[module] startBackgroundTaskAutomatically: Headless task
|
|
369
|
+
"[module] startBackgroundTaskAutomatically: Headless task is not registered"
|
|
369
370
|
)
|
|
370
371
|
return
|
|
371
372
|
}
|
|
@@ -446,6 +447,7 @@ class CallingxModule(reactContext: ReactApplicationContext) : NativeCallingxSpec
|
|
|
446
447
|
private fun getReceiverFilter(): IntentFilter =
|
|
447
448
|
IntentFilter().apply {
|
|
448
449
|
addAction(CALL_REGISTERED_ACTION)
|
|
450
|
+
addAction(CALL_REGISTERED_INCOMING_ACTION)
|
|
449
451
|
addAction(CALL_ANSWERED_ACTION)
|
|
450
452
|
addAction(CALL_ACTIVE_ACTION)
|
|
451
453
|
addAction(CALL_INACTIVE_ACTION)
|
|
@@ -560,6 +562,9 @@ class CallingxModule(reactContext: ReactApplicationContext) : NativeCallingxSpec
|
|
|
560
562
|
CALL_REGISTERED_ACTION -> {
|
|
561
563
|
sendJSEvent("didReceiveStartCallAction", params)
|
|
562
564
|
}
|
|
565
|
+
CALL_REGISTERED_INCOMING_ACTION -> {
|
|
566
|
+
sendJSEvent("didDisplayIncomingCall", params)
|
|
567
|
+
}
|
|
563
568
|
CALL_ANSWERED_ACTION -> {
|
|
564
569
|
if (intent.hasExtra(EXTRA_SOURCE)) {
|
|
565
570
|
params.putString("source", intent.getStringExtra(EXTRA_SOURCE))
|
package/android/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt
CHANGED
|
@@ -4,6 +4,7 @@ import android.app.Notification
|
|
|
4
4
|
import android.content.Context
|
|
5
5
|
import android.media.Ringtone
|
|
6
6
|
import android.media.RingtoneManager
|
|
7
|
+
import android.net.Uri
|
|
7
8
|
import android.os.Build
|
|
8
9
|
import android.telecom.DisconnectCause
|
|
9
10
|
import android.util.Log
|
|
@@ -44,11 +45,35 @@ class CallNotificationManager(
|
|
|
44
45
|
|
|
45
46
|
private var hasBecameActive = false
|
|
46
47
|
|
|
48
|
+
private var lastPostedSnapshot: NotificationSnapshot? = null
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Snapshot of call state used to detect notification changes.
|
|
52
|
+
* Using a data class ensures immutable comparison and avoids issues
|
|
53
|
+
* with mutable Call.Registered objects.
|
|
54
|
+
*/
|
|
55
|
+
private data class NotificationSnapshot(
|
|
56
|
+
val id: String,
|
|
57
|
+
val isActive: Boolean,
|
|
58
|
+
val isIncoming: Boolean,
|
|
59
|
+
val displayTitle: String?,
|
|
60
|
+
val displaySubtitle: String?,
|
|
61
|
+
val displayName: CharSequence,
|
|
62
|
+
val address: Uri
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
private fun Call.Registered.toSnapshot() = NotificationSnapshot(
|
|
66
|
+
id = id,
|
|
67
|
+
isActive = isActive,
|
|
68
|
+
isIncoming = isIncoming(),
|
|
69
|
+
displayTitle = displayOptions?.getString(CallService.EXTRA_DISPLAY_TITLE),
|
|
70
|
+
displaySubtitle = displayOptions?.getString(CallService.EXTRA_DISPLAY_SUBTITLE),
|
|
71
|
+
displayName = callAttributes.displayName,
|
|
72
|
+
address = callAttributes.address
|
|
73
|
+
)
|
|
74
|
+
|
|
47
75
|
fun createNotification(call: Call.Registered): Notification {
|
|
48
|
-
debugLog(
|
|
49
|
-
TAG,
|
|
50
|
-
"[notifications] createNotification: Creating notification for call ID: ${call.id}"
|
|
51
|
-
)
|
|
76
|
+
debugLog(TAG,"[notifications] createNotification: Creating notification for call ID: ${call.id}")
|
|
52
77
|
|
|
53
78
|
val contentIntent =
|
|
54
79
|
NotificationIntentFactory.getLaunchActivityIntent(
|
|
@@ -90,19 +115,22 @@ class CallNotificationManager(
|
|
|
90
115
|
fun updateCallNotification(call: Call) {
|
|
91
116
|
when (call) {
|
|
92
117
|
Call.None, is Call.Unregistered -> {
|
|
93
|
-
debugLog(
|
|
94
|
-
TAG,
|
|
95
|
-
"[notifications] updateCallNotification: Dismissing notification (call is None or Unregistered)"
|
|
96
|
-
)
|
|
118
|
+
debugLog(TAG, "[notifications] updateCallNotification: Dismissing notification (call is None or Unregistered)")
|
|
97
119
|
notificationManager.cancel(NOTIFICATION_ID)
|
|
120
|
+
lastPostedSnapshot = null
|
|
121
|
+
hasBecameActive = false
|
|
98
122
|
}
|
|
99
123
|
is Call.Registered -> {
|
|
124
|
+
val newSnapshot = call.toSnapshot()
|
|
125
|
+
if (newSnapshot == lastPostedSnapshot) {
|
|
126
|
+
debugLog(TAG, "[notifications] updateCallNotification: Skipping - no state change")
|
|
127
|
+
return
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
lastPostedSnapshot = newSnapshot
|
|
100
131
|
val notification = createNotification(call)
|
|
101
132
|
notificationManager.notify(NOTIFICATION_ID, notification)
|
|
102
|
-
debugLog(
|
|
103
|
-
TAG,
|
|
104
|
-
"[notifications] updateCallNotification: Notification posted successfully"
|
|
105
|
-
)
|
|
133
|
+
debugLog(TAG, "[notifications] updateCallNotification: Notification posted successfully")
|
|
106
134
|
}
|
|
107
135
|
}
|
|
108
136
|
}
|
|
@@ -110,6 +138,7 @@ class CallNotificationManager(
|
|
|
110
138
|
fun cancelNotifications() {
|
|
111
139
|
notificationManager.cancel(NOTIFICATION_ID)
|
|
112
140
|
hasBecameActive = false
|
|
141
|
+
lastPostedSnapshot = null
|
|
113
142
|
}
|
|
114
143
|
|
|
115
144
|
fun startRingtone() {
|
|
@@ -212,4 +241,5 @@ class CallNotificationManager(
|
|
|
212
241
|
.setImportant(true)
|
|
213
242
|
.build()
|
|
214
243
|
}
|
|
244
|
+
|
|
215
245
|
}
|
|
@@ -34,7 +34,7 @@ abstract class CallRepository(protected val context: Context) {
|
|
|
34
34
|
fun onIsCallDisconnected(callId: String?, cause: DisconnectCause, source: EventSource)
|
|
35
35
|
fun onIsCallInactive(callId: String)
|
|
36
36
|
fun onIsCallActive(callId: String)
|
|
37
|
-
fun onCallRegistered(callId: String)
|
|
37
|
+
fun onCallRegistered(callId: String, incoming: Boolean)
|
|
38
38
|
fun onMuteCallChanged(callId: String, isMuted: Boolean)
|
|
39
39
|
fun onCallEndpointChanged(callId: String, endpoint: String)
|
|
40
40
|
}
|
|
@@ -7,6 +7,7 @@ import android.util.Log
|
|
|
7
7
|
import androidx.core.telecom.CallAttributesCompat
|
|
8
8
|
import io.getstream.rn.callingx.model.Call
|
|
9
9
|
import io.getstream.rn.callingx.model.CallAction
|
|
10
|
+
import kotlinx.coroutines.Job
|
|
10
11
|
import kotlinx.coroutines.cancel
|
|
11
12
|
import kotlinx.coroutines.channels.Channel
|
|
12
13
|
import kotlinx.coroutines.flow.consumeAsFlow
|
|
@@ -20,12 +21,15 @@ class LegacyCallRepository(context: Context) : CallRepository(context) {
|
|
|
20
21
|
private const val TAG = "[Callingx] LegacyCallRepository"
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
private var observeCallStateJob: Job? = null
|
|
25
|
+
|
|
23
26
|
override fun getTag(): String = TAG
|
|
24
27
|
|
|
25
28
|
override fun setListener(listener: Listener?) {
|
|
26
29
|
this._listener = listener
|
|
27
30
|
// Observe call state changes
|
|
28
|
-
|
|
31
|
+
observeCallStateJob?.cancel()
|
|
32
|
+
observeCallStateJob = scope.launch {
|
|
29
33
|
try {
|
|
30
34
|
currentCall.collect { _listener?.onCallStateChanged(it) }
|
|
31
35
|
} catch (e: Exception) {
|
|
@@ -37,6 +41,8 @@ class LegacyCallRepository(context: Context) : CallRepository(context) {
|
|
|
37
41
|
override fun release() {
|
|
38
42
|
_currentCall.value = Call.None
|
|
39
43
|
|
|
44
|
+
observeCallStateJob?.cancel()
|
|
45
|
+
observeCallStateJob = null
|
|
40
46
|
_listener = null
|
|
41
47
|
|
|
42
48
|
scope.cancel()
|
|
@@ -76,7 +82,7 @@ class LegacyCallRepository(context: Context) : CallRepository(context) {
|
|
|
76
82
|
actionSource = actionSource,
|
|
77
83
|
)
|
|
78
84
|
|
|
79
|
-
_listener?.onCallRegistered(callId)
|
|
85
|
+
_listener?.onCallRegistered(callId, isIncoming)
|
|
80
86
|
|
|
81
87
|
// Process actions without telecom SDK
|
|
82
88
|
scope.launch {
|
|
@@ -199,9 +199,7 @@ class TelecomCallRepository(context: Context) : CallRepository(context) {
|
|
|
199
199
|
.onEach { (previous, current) ->
|
|
200
200
|
when {
|
|
201
201
|
previous is Call.None && current is Call.Registered -> {
|
|
202
|
-
|
|
203
|
-
_listener?.onCallRegistered(current.id)
|
|
204
|
-
}
|
|
202
|
+
_listener?.onCallRegistered(current.id, current.isIncoming())
|
|
205
203
|
}
|
|
206
204
|
previous is Call.Registered && current is Call.Registered -> {
|
|
207
205
|
if (previous.isMuted != current.isMuted) {
|
|
@@ -372,9 +370,7 @@ class TelecomCallRepository(context: Context) : CallRepository(context) {
|
|
|
372
370
|
updateCurrentCall { copy(isActive = true, isOnHold = false) }
|
|
373
371
|
|
|
374
372
|
val call = _currentCall.value
|
|
375
|
-
val source =
|
|
376
|
-
if (isSelfAnswered) EventSource.APP
|
|
377
|
-
else EventSource.SYS
|
|
373
|
+
val source = if (isSelfAnswered) EventSource.APP else EventSource.SYS
|
|
378
374
|
if (call is Call.Registered) {
|
|
379
375
|
_listener?.onIsCallAnswered(call.id, source)
|
|
380
376
|
}
|
|
@@ -388,9 +384,7 @@ class TelecomCallRepository(context: Context) : CallRepository(context) {
|
|
|
388
384
|
TAG,
|
|
389
385
|
"[repository] onIsCallDisconnected: Call disconnected, cause: ${it.reason}, description: ${it.description}"
|
|
390
386
|
)
|
|
391
|
-
val source =
|
|
392
|
-
if (isSelfDisconnected) EventSource.APP
|
|
393
|
-
else EventSource.SYS
|
|
387
|
+
val source = if (isSelfDisconnected) EventSource.APP else EventSource.SYS
|
|
394
388
|
var callId: String? = null
|
|
395
389
|
if (_currentCall.value is Call.Registered) {
|
|
396
390
|
callId = (_currentCall.value as Call.Registered).id
|
|
@@ -15,7 +15,7 @@ import stream_react_native_webrtc
|
|
|
15
15
|
#else
|
|
16
16
|
categoryOptions = [.allowBluetooth, .defaultToSpeaker]
|
|
17
17
|
#endif
|
|
18
|
-
let mode: AVAudioSession.Mode = .
|
|
18
|
+
let mode: AVAudioSession.Mode = .voiceChat
|
|
19
19
|
|
|
20
20
|
// Configure RTCAudioSessionConfiguration to match our intended settings
|
|
21
21
|
// This ensures WebRTC's internal state stays consistent during interruptions/route changes
|
|
@@ -31,12 +31,7 @@ import stream_react_native_webrtc
|
|
|
31
31
|
defer { rtcSession.unlockForConfiguration() }
|
|
32
32
|
|
|
33
33
|
do {
|
|
34
|
-
try rtcSession.
|
|
35
|
-
|
|
36
|
-
// Apply sample rate and IO buffer duration from WebRTC's config (source of truth)
|
|
37
|
-
// This keeps CallKit setup aligned with WebRTC's intended tuning (e.g. 48kHz and ~20ms by default)
|
|
38
|
-
try rtcSession.setPreferredSampleRate(rtcConfig.sampleRate)
|
|
39
|
-
try rtcSession.setPreferredIOBufferDuration(rtcConfig.ioBufferDuration)
|
|
34
|
+
try rtcSession.setConfiguration(rtcConfig)
|
|
40
35
|
} catch {
|
|
41
36
|
#if DEBUG
|
|
42
37
|
print("[Callingx][createAudioSessionIfNeeded] Error configuring audio session: \(error)")
|
package/ios/CallingxImpl.swift
CHANGED
|
@@ -110,6 +110,7 @@ import stream_react_native_webrtc
|
|
|
110
110
|
#if DEBUG
|
|
111
111
|
print("[Callingx][reportNewIncomingCall] callId already exists")
|
|
112
112
|
#endif
|
|
113
|
+
completion?()
|
|
113
114
|
return
|
|
114
115
|
}
|
|
115
116
|
|
|
@@ -384,6 +385,7 @@ import stream_react_native_webrtc
|
|
|
384
385
|
callerName: String,
|
|
385
386
|
hasVideo: Bool
|
|
386
387
|
) -> Bool {
|
|
388
|
+
let uuid = CallingxImpl.uuidStorage?.getUUID(forCid: callId)
|
|
387
389
|
CallingxImpl.reportNewIncomingCall(
|
|
388
390
|
callId: callId,
|
|
389
391
|
handle: phoneNumber,
|
|
@@ -399,15 +401,18 @@ import stream_react_native_webrtc
|
|
|
399
401
|
completion: nil
|
|
400
402
|
)
|
|
401
403
|
|
|
402
|
-
let
|
|
403
|
-
if
|
|
404
|
-
let
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
404
|
+
let wasAlreadyAnswered = uuid != nil
|
|
405
|
+
if !wasAlreadyAnswered {
|
|
406
|
+
let settings = Settings.getSettings()
|
|
407
|
+
if let timeout = settings["displayCallTimeout"] as? Int {
|
|
408
|
+
let popTime = DispatchTime.now() + .milliseconds(timeout)
|
|
409
|
+
DispatchQueue.main.asyncAfter(deadline: popTime) { [weak self] in
|
|
410
|
+
guard let self = self, !self.isSetup else { return }
|
|
411
|
+
#if DEBUG
|
|
412
|
+
print("[Callingx] Displayed a call without a reachable app, ending the call: \(callId)")
|
|
413
|
+
#endif
|
|
414
|
+
CallingxImpl.endCall(callId, reason: CXCallEndedReason.failed.rawValue)
|
|
415
|
+
}
|
|
411
416
|
}
|
|
412
417
|
}
|
|
413
418
|
return true
|
|
@@ -519,6 +524,13 @@ import stream_react_native_webrtc
|
|
|
519
524
|
#endif
|
|
520
525
|
|
|
521
526
|
guard let storage = CallingxImpl.uuidStorage else { return }
|
|
527
|
+
|
|
528
|
+
if (storage.containsCid(callId)) {
|
|
529
|
+
#if DEBUG
|
|
530
|
+
print("[Callingx][startCall] Call \(callId) is already registered")
|
|
531
|
+
#endif
|
|
532
|
+
return
|
|
533
|
+
}
|
|
522
534
|
|
|
523
535
|
let handleType = Settings.getHandleType("generic")
|
|
524
536
|
let uuid = storage.getOrCreateUUID(forCid: callId)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/react-native-callingx",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
4
|
"description": "CallKit and Telecom API capabilities for React Native",
|
|
5
5
|
"main": "./dist/module/index.js",
|
|
6
6
|
"module": "./dist/module/index.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@react-native-community/cli": "20.0.1",
|
|
63
63
|
"@react-native/babel-preset": "^0.81.5",
|
|
64
|
-
"@stream-io/react-native-webrtc": "137.1.
|
|
64
|
+
"@stream-io/react-native-webrtc": "137.1.1",
|
|
65
65
|
"@types/react": "^19.1.0",
|
|
66
66
|
"del-cli": "^6.0.0",
|
|
67
67
|
"react": "19.1.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"typescript": "^5.9.2"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@stream-io/react-native-webrtc": ">=137.1.
|
|
73
|
+
"@stream-io/react-native-webrtc": ">=137.1.1",
|
|
74
74
|
"react": "*",
|
|
75
75
|
"react-native": "*"
|
|
76
76
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/src/main/assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/src/debug/assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet></merger>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/src/debug/jniLibs"/></dataSet></merger>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/greenfrvr/dev/stream/stream-video-js/sample-apps/react-native/dogfood/node_modules/@stream-io/react-native-callingx/android/src/debug/shaders"/></dataSet></merger>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|