@telnyx/react-voice-commons-sdk 0.1.6 → 0.1.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/ios/CallKitBridge.m +1 -1
- package/ios/CallKitBridge.swift +1 -11
- package/ios/README.md +2 -2
- package/lib/callkit/callkit-coordinator.d.ts +4 -1
- package/lib/callkit/callkit-coordinator.js +10 -3
- package/lib/hooks/use-callkit-coordinator.js +5 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +7 -0
- package/lib/internal/calls/call-state-controller.d.ts +9 -0
- package/lib/internal/calls/call-state-controller.js +51 -24
- package/lib/telnyx-voice-app.js +140 -151
- package/lib/telnyx-voip-client.d.ts +47 -2
- package/lib/telnyx-voip-client.js +79 -3
- package/package.json +4 -2
- package/src/callkit/callkit-coordinator.ts +12 -3
- package/src/hooks/use-callkit-coordinator.ts +5 -0
- package/src/index.ts +1 -0
- package/src/internal/calls/call-state-controller.ts +56 -24
- package/src/telnyx-voice-app.tsx +168 -170
- package/src/telnyx-voip-client.ts +84 -3
- package/android/build/.transforms/35d64beab84343a7420320f8057c40b9/results.bin +0 -1
- package/android/build/.transforms/35d64beab84343a7420320f8057c40b9/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/results.bin +0 -1
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/BuildConfig.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/CallForegroundService$Companion.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/CallForegroundService.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxMainActivity$Companion.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxMainActivity.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationHelper$Companion.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationHelper.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgeModule$Companion.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgeModule.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgePackage.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnManager.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/8ebc6907344eccd2b9c23d903854d4fb/results.bin +0 -1
- package/android/build/.transforms/8ebc6907344eccd2b9c23d903854d4fb/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/results.bin +0 -1
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/BuildConfig.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxMainActivity$Companion.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxMainActivity.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationHelper$Companion.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationHelper.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgeModule.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgePackage.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnManager.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/generated/source/buildConfig/debug/com/telnyx/react_voice_commons/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -42
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/telnyx_react-voice-commons-sdk_debug.kotlin_module +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/telnyx/react_voice_commons/BuildConfig.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -75
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -42
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/telnyx_react-voice-commons-sdk_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/CallForegroundService$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/CallForegroundService.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxMainActivity$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxMainActivity.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxNotificationHelper$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxNotificationHelper.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/VoicePnBridgeModule$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/VoicePnBridgeModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/VoicePnBridgePackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/VoicePnManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -82
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/telnyx_react-voice-commons-sdk_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/CallForegroundService$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/CallForegroundService.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxMainActivity$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxMainActivity.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxNotificationHelper$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxNotificationHelper.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/VoicePnBridgeModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/VoicePnBridgeModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/VoicePnBridgePackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/VoicePnManager.class +0 -0
- package/android/local.properties +0 -8
package/lib/telnyx-voice-app.js
CHANGED
|
@@ -194,6 +194,98 @@ const TelnyxVoiceAppComponent = ({
|
|
|
194
194
|
log('Auto-reconnection error - redirecting to login screen');
|
|
195
195
|
}
|
|
196
196
|
}, [voipClient, log]);
|
|
197
|
+
// Retrieve pending push data from the Android native bridge
|
|
198
|
+
const getAndroidPushData = async () => {
|
|
199
|
+
try {
|
|
200
|
+
const { NativeModules } = require('react-native');
|
|
201
|
+
const VoicePnBridge = NativeModules.VoicePnBridge;
|
|
202
|
+
if (!VoicePnBridge) {
|
|
203
|
+
log('VoicePnBridge not available on Android');
|
|
204
|
+
return { pushData: null, earlyReturn: false };
|
|
205
|
+
}
|
|
206
|
+
log('Checking for pending push actions via VoicePnBridge');
|
|
207
|
+
// Check for pending call actions (notification button taps like hangup/answer)
|
|
208
|
+
const pendingCallAction = await VoicePnBridge.getPendingCallAction();
|
|
209
|
+
log('Raw pending call action response:', pendingCallAction);
|
|
210
|
+
if (pendingCallAction?.action === 'hangup' && pendingCallAction.callId) {
|
|
211
|
+
log('Processing hangup action from notification for call:', pendingCallAction.callId);
|
|
212
|
+
const activeCall = voipClient.currentActiveCall;
|
|
213
|
+
if (activeCall && activeCall.callId === pendingCallAction.callId) {
|
|
214
|
+
log('Hanging up active call from notification action');
|
|
215
|
+
try {
|
|
216
|
+
await activeCall.hangup();
|
|
217
|
+
log('Call hung up successfully from notification action');
|
|
218
|
+
} catch (error) {
|
|
219
|
+
log('Error hanging up call from notification action:', error);
|
|
220
|
+
}
|
|
221
|
+
} else {
|
|
222
|
+
log('No matching active call found for hangup action');
|
|
223
|
+
}
|
|
224
|
+
await VoicePnBridge.clearPendingCallAction();
|
|
225
|
+
return { pushData: null, earlyReturn: true };
|
|
226
|
+
}
|
|
227
|
+
// Check for regular push notification data
|
|
228
|
+
const pendingAction = await VoicePnBridge.getPendingPushAction();
|
|
229
|
+
log('Raw pending action response:', pendingAction);
|
|
230
|
+
if (pendingAction?.action != null && pendingAction?.metadata != null) {
|
|
231
|
+
log('Found pending push action:', pendingAction);
|
|
232
|
+
let metadata = pendingAction.metadata;
|
|
233
|
+
try {
|
|
234
|
+
metadata = JSON.parse(metadata);
|
|
235
|
+
log('Parsed metadata as JSON:', metadata);
|
|
236
|
+
} catch (e) {
|
|
237
|
+
log('JSON parse failed, trying Android key-value format');
|
|
238
|
+
}
|
|
239
|
+
await VoicePnBridge.clearPendingPushAction();
|
|
240
|
+
log('Cleared pending push action after retrieval');
|
|
241
|
+
return {
|
|
242
|
+
pushData: { action: pendingAction.action, metadata, from_notification: true },
|
|
243
|
+
earlyReturn: false,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
log('No pending push actions found');
|
|
247
|
+
return { pushData: null, earlyReturn: false };
|
|
248
|
+
} catch (bridgeError) {
|
|
249
|
+
log('Error accessing VoicePnBridge on Android:', bridgeError);
|
|
250
|
+
return { pushData: null, earlyReturn: false };
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
// Retrieve pending push data from the iOS native bridge
|
|
254
|
+
const getIOSPushData = async () => {
|
|
255
|
+
try {
|
|
256
|
+
const { NativeModules } = require('react-native');
|
|
257
|
+
const VoicePnBridge = NativeModules.VoicePnBridge;
|
|
258
|
+
if (!VoicePnBridge) {
|
|
259
|
+
log('VoicePnBridge not available on iOS');
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
log('Checking for pending VoIP push data via iOS VoicePnBridge');
|
|
263
|
+
const pendingVoipPushJson = await VoicePnBridge.getPendingVoipPush();
|
|
264
|
+
log('Raw pending VoIP push response:', pendingVoipPushJson);
|
|
265
|
+
if (!pendingVoipPushJson) {
|
|
266
|
+
log('No pending VoIP push data found');
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
try {
|
|
270
|
+
const pendingVoipPush = JSON.parse(pendingVoipPushJson);
|
|
271
|
+
const voipPayload = pendingVoipPush?.payload;
|
|
272
|
+
if (!voipPayload?.metadata) {
|
|
273
|
+
log('Invalid VoIP push data structure');
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
log('Found pending VoIP push data:', voipPayload);
|
|
277
|
+
await VoicePnBridge.clearPendingVoipPush();
|
|
278
|
+
log('Cleared pending VoIP push data after retrieval');
|
|
279
|
+
return { action: 'incoming_call', metadata: voipPayload.metadata, from_notification: true };
|
|
280
|
+
} catch (parseError) {
|
|
281
|
+
log('Error parsing VoIP push JSON:', parseError);
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
} catch (bridgeError) {
|
|
285
|
+
log('Error accessing VoicePnBridge on iOS:', bridgeError);
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
197
289
|
// Check for initial push notification action when app launches
|
|
198
290
|
const checkForInitialPushNotification = (0, react_1.useCallback)(
|
|
199
291
|
async (fromAppResume = false) => {
|
|
@@ -202,178 +294,62 @@ const TelnyxVoiceAppComponent = ({
|
|
|
202
294
|
log('Already processing push, returning early');
|
|
203
295
|
return;
|
|
204
296
|
}
|
|
205
|
-
// Only set the flag if this is not from app resume to allow resume processing
|
|
206
297
|
if (!fromAppResume) {
|
|
207
298
|
setProcessingPushOnLaunch(true);
|
|
208
299
|
}
|
|
209
300
|
onPushNotificationProcessingStarted?.();
|
|
210
301
|
try {
|
|
302
|
+
// Retrieve pending push data from the native layer
|
|
211
303
|
let pushData = null;
|
|
212
|
-
// Try to get push data from the native layer using platform-specific methods
|
|
213
304
|
if (react_native_1.Platform.OS === 'android') {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
const VoicePnBridge = NativeModules.VoicePnBridge;
|
|
218
|
-
if (VoicePnBridge) {
|
|
219
|
-
log('Checking for pending push actions via VoicePnBridge');
|
|
220
|
-
// First check for pending call actions (notification button taps like hangup/answer)
|
|
221
|
-
const pendingCallAction = await VoicePnBridge.getPendingCallAction();
|
|
222
|
-
log('Raw pending call action response:', pendingCallAction);
|
|
223
|
-
if (pendingCallAction && pendingCallAction.action != null) {
|
|
224
|
-
log('Found pending call action:', pendingCallAction);
|
|
225
|
-
// Handle call actions directly
|
|
226
|
-
if (pendingCallAction.action === 'hangup' && pendingCallAction.callId) {
|
|
227
|
-
log(
|
|
228
|
-
'Processing hangup action from notification for call:',
|
|
229
|
-
pendingCallAction.callId
|
|
230
|
-
);
|
|
231
|
-
// Find and hangup the call
|
|
232
|
-
const activeCall = voipClient.currentActiveCall;
|
|
233
|
-
if (activeCall && activeCall.callId === pendingCallAction.callId) {
|
|
234
|
-
log('Hanging up active call from notification action');
|
|
235
|
-
try {
|
|
236
|
-
await activeCall.hangup();
|
|
237
|
-
log('Call hung up successfully from notification action');
|
|
238
|
-
} catch (error) {
|
|
239
|
-
log('Error hanging up call from notification action:', error);
|
|
240
|
-
}
|
|
241
|
-
} else {
|
|
242
|
-
log('No matching active call found for hangup action');
|
|
243
|
-
}
|
|
244
|
-
// Clear the pending action
|
|
245
|
-
await VoicePnBridge.clearPendingCallAction();
|
|
246
|
-
return; // Don't process as push data
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
// Then check for regular push notification data
|
|
250
|
-
const pendingAction = await VoicePnBridge.getPendingPushAction();
|
|
251
|
-
log('Raw pending action response:', pendingAction);
|
|
252
|
-
if (pendingAction && pendingAction.action != null && pendingAction.metadata != null) {
|
|
253
|
-
log('Found pending push action:', pendingAction);
|
|
254
|
-
// Parse the metadata if it's a string
|
|
255
|
-
let metadata = pendingAction.metadata;
|
|
256
|
-
try {
|
|
257
|
-
// First try parsing as JSON
|
|
258
|
-
metadata = JSON.parse(metadata);
|
|
259
|
-
log('Parsed metadata as JSON:', metadata);
|
|
260
|
-
} catch (e) {
|
|
261
|
-
log('JSON parse failed, trying Android key-value format');
|
|
262
|
-
}
|
|
263
|
-
// Create push data structure that matches what the VoIP client expects
|
|
264
|
-
pushData = {
|
|
265
|
-
action: pendingAction.action,
|
|
266
|
-
metadata: metadata,
|
|
267
|
-
from_notification: true,
|
|
268
|
-
};
|
|
269
|
-
// Clear the pending action so it doesn't get processed again
|
|
270
|
-
await VoicePnBridge.clearPendingPushAction();
|
|
271
|
-
log('Cleared pending push action after retrieval');
|
|
272
|
-
} else {
|
|
273
|
-
log('No pending push actions found');
|
|
274
|
-
}
|
|
275
|
-
} else {
|
|
276
|
-
log('VoicePnBridge not available on Android');
|
|
277
|
-
}
|
|
278
|
-
} catch (bridgeError) {
|
|
279
|
-
log('Error accessing VoicePnBridge on Android:', bridgeError);
|
|
280
|
-
}
|
|
305
|
+
const result = await getAndroidPushData();
|
|
306
|
+
if (result.earlyReturn) return;
|
|
307
|
+
pushData = result.pushData;
|
|
281
308
|
} else if (react_native_1.Platform.OS === 'ios') {
|
|
282
|
-
|
|
283
|
-
// Import the native bridge module dynamically (same as Android)
|
|
284
|
-
const { NativeModules } = require('react-native');
|
|
285
|
-
const VoicePnBridge = NativeModules.VoicePnBridge;
|
|
286
|
-
if (VoicePnBridge) {
|
|
287
|
-
log('Checking for pending VoIP push data via iOS VoicePnBridge');
|
|
288
|
-
// Check for VoIP push notification data stored by the native push handler
|
|
289
|
-
const pendingVoipPushJson = await VoicePnBridge.getPendingVoipPush();
|
|
290
|
-
log('Raw pending VoIP push response:', pendingVoipPushJson);
|
|
291
|
-
if (pendingVoipPushJson) {
|
|
292
|
-
try {
|
|
293
|
-
const pendingVoipPush = JSON.parse(pendingVoipPushJson);
|
|
294
|
-
const voipPayload = pendingVoipPush?.payload;
|
|
295
|
-
if (voipPayload && voipPayload.metadata) {
|
|
296
|
-
log('Found pending VoIP push data:', voipPayload);
|
|
297
|
-
// Create push data structure that matches what the VoIP client expects
|
|
298
|
-
pushData = {
|
|
299
|
-
action: 'incoming_call',
|
|
300
|
-
metadata: voipPayload.metadata,
|
|
301
|
-
from_notification: true,
|
|
302
|
-
};
|
|
303
|
-
// Clear the pending VoIP push data so it doesn't get processed again
|
|
304
|
-
await VoicePnBridge.clearPendingVoipPush();
|
|
305
|
-
log('Cleared pending VoIP push data after retrieval');
|
|
306
|
-
} else {
|
|
307
|
-
log('Invalid VoIP push data structure');
|
|
308
|
-
}
|
|
309
|
-
} catch (parseError) {
|
|
310
|
-
log('Error parsing VoIP push JSON:', parseError);
|
|
311
|
-
}
|
|
312
|
-
} else {
|
|
313
|
-
log('No pending VoIP push data found');
|
|
314
|
-
}
|
|
315
|
-
} else {
|
|
316
|
-
log('VoicePnBridge not available on iOS');
|
|
317
|
-
}
|
|
318
|
-
} catch (bridgeError) {
|
|
319
|
-
log('Error accessing VoicePnBridge on iOS:', bridgeError);
|
|
320
|
-
}
|
|
309
|
+
pushData = await getIOSPushData();
|
|
321
310
|
} else {
|
|
322
311
|
log('Push data check skipped - unsupported platform');
|
|
323
312
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
if (
|
|
346
|
-
// On iOS, coordinate with CallKit by notifying the coordinator about the push
|
|
313
|
+
if (!pushData) {
|
|
314
|
+
log('No initial push data found');
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
log('Processing initial push notification...');
|
|
318
|
+
// Prevent duplicate processing if already connected
|
|
319
|
+
if (
|
|
320
|
+
voipClient.currentConnectionState === connection_state_1.TelnyxConnectionState.CONNECTED
|
|
321
|
+
) {
|
|
322
|
+
log('SKIPPING - Already connected, preventing duplicate processing');
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
// Set flags to prevent auto-reconnection during push call
|
|
326
|
+
setIsHandlingForegroundCall(true);
|
|
327
|
+
backgroundDetectorIgnore.current = true;
|
|
328
|
+
log(`Background detector ignore set to: true at ${new Date().toISOString()}`);
|
|
329
|
+
log(`Foreground call handling flag set to: true at ${new Date().toISOString()}`);
|
|
330
|
+
disposeBackgroundClient();
|
|
331
|
+
// On iOS, coordinate with CallKit using the call_id from push metadata
|
|
332
|
+
if (react_native_1.Platform.OS === 'ios') {
|
|
333
|
+
const callId = pushData.metadata?.call_id;
|
|
334
|
+
if (callId) {
|
|
347
335
|
const { callKitCoordinator } = require('./callkit/callkit-coordinator');
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
callData: { source: 'push_notification' },
|
|
354
|
-
pushData: pushData,
|
|
355
|
-
});
|
|
356
|
-
} else {
|
|
357
|
-
log('No call_id found in push data, falling back to direct handling');
|
|
358
|
-
await voipClient.handlePushNotification(pushData);
|
|
359
|
-
}
|
|
336
|
+
log('Notifying CallKit coordinator about push notification:', callId);
|
|
337
|
+
await callKitCoordinator.handleCallKitPushReceived(callId, {
|
|
338
|
+
callData: { source: 'push_notification' },
|
|
339
|
+
pushData: pushData,
|
|
340
|
+
});
|
|
360
341
|
} else {
|
|
361
|
-
|
|
342
|
+
log('No call_id found in push data, falling back to direct handling');
|
|
362
343
|
await voipClient.handlePushNotification(pushData);
|
|
363
344
|
}
|
|
364
|
-
log('Initial push notification processed');
|
|
365
|
-
log('Cleared stored push data to prevent duplicate processing');
|
|
366
|
-
// Note: isHandlingForegroundCall will be reset when calls.length becomes 0
|
|
367
|
-
// This prevents premature disconnection during CallKit answer flow
|
|
368
345
|
} else {
|
|
369
|
-
|
|
346
|
+
await voipClient.handlePushNotification(pushData);
|
|
370
347
|
}
|
|
348
|
+
log('Initial push notification processed');
|
|
371
349
|
} catch (e) {
|
|
372
350
|
log('Error processing initial push notification:', e);
|
|
373
|
-
// Reset flags on error
|
|
374
351
|
setIsHandlingForegroundCall(false);
|
|
375
352
|
} finally {
|
|
376
|
-
// Always reset the processing flag - it should not remain stuck
|
|
377
353
|
setProcessingPushOnLaunch(false);
|
|
378
354
|
onPushNotificationProcessingCompleted?.();
|
|
379
355
|
}
|
|
@@ -402,6 +378,19 @@ const TelnyxVoiceAppComponent = ({
|
|
|
402
378
|
});
|
|
403
379
|
return backgroundClient;
|
|
404
380
|
}, [debug, log]);
|
|
381
|
+
// Auto-wire the voipClient on the CallKit coordinator so consumers don't
|
|
382
|
+
// have to call setVoipClient() manually at the right level.
|
|
383
|
+
(0, react_1.useEffect)(() => {
|
|
384
|
+
if (react_native_1.Platform.OS === 'ios') {
|
|
385
|
+
try {
|
|
386
|
+
const { callKitCoordinator } = require('./callkit/callkit-coordinator');
|
|
387
|
+
callKitCoordinator.setVoipClient(voipClient);
|
|
388
|
+
log('Auto-wired voipClient on CallKit coordinator');
|
|
389
|
+
} catch (e) {
|
|
390
|
+
log('Error auto-wiring voipClient on CallKit coordinator:', e);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}, [voipClient, log]);
|
|
405
394
|
// Setup effect
|
|
406
395
|
(0, react_1.useEffect)(() => {
|
|
407
396
|
// Listen to connection state changes
|
|
@@ -27,6 +27,16 @@ export declare class TelnyxVoipClient {
|
|
|
27
27
|
private readonly _callStateController;
|
|
28
28
|
private readonly _options;
|
|
29
29
|
private _disposed;
|
|
30
|
+
/**
|
|
31
|
+
* Check if the app was launched from a push notification.
|
|
32
|
+
*
|
|
33
|
+
* Use this to avoid double-login on cold start. When true, the SDK will
|
|
34
|
+
* handle login internally via the push notification flow, so you should
|
|
35
|
+
* skip your normal auto-login.
|
|
36
|
+
*
|
|
37
|
+
* @returns true if there is pending push notification data indicating a push-launched app
|
|
38
|
+
*/
|
|
39
|
+
static isLaunchedFromPushNotification(): Promise<boolean>;
|
|
30
40
|
/**
|
|
31
41
|
* Creates a new TelnyxVoipClient instance.
|
|
32
42
|
*
|
|
@@ -69,6 +79,27 @@ export declare class TelnyxVoipClient {
|
|
|
69
79
|
* Current active call (synchronous access).
|
|
70
80
|
*/
|
|
71
81
|
get currentActiveCall(): Call | null;
|
|
82
|
+
/**
|
|
83
|
+
* Check if there are any active calls (not in ENDED or FAILED state).
|
|
84
|
+
* Matches TelnyxRTC `hasActiveCalls` property for multi-call support.
|
|
85
|
+
*/
|
|
86
|
+
get hasActiveCalls(): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Access any active call tracked by the client.
|
|
89
|
+
* A call will be accessible until it has ended (transitioned to the ENDED state).
|
|
90
|
+
* This matches the TelnyxRTC `getCall(callId)` method for multi-call support.
|
|
91
|
+
*
|
|
92
|
+
* @param callId The unique identifier of a call.
|
|
93
|
+
* @returns The Call object that matches the requested callId, or null if not found.
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const call = voipClient.getCall('some-call-uuid');
|
|
97
|
+
* if (call) {
|
|
98
|
+
* console.log('Call state:', call.currentState);
|
|
99
|
+
* }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
getCall(callId: string): Call | null;
|
|
72
103
|
/**
|
|
73
104
|
* Current session ID (UUID) for this connection.
|
|
74
105
|
*/
|
|
@@ -192,11 +223,25 @@ export declare class TelnyxVoipClient {
|
|
|
192
223
|
private _throwIfDisposed;
|
|
193
224
|
}
|
|
194
225
|
/**
|
|
195
|
-
* Create
|
|
226
|
+
* Create or retrieve the shared TelnyxVoipClient instance.
|
|
227
|
+
*
|
|
228
|
+
* This uses a singleton pattern — calling it multiple times (e.g., inside a
|
|
229
|
+
* React component body) always returns the same instance. If you need to
|
|
230
|
+
* reset the instance, call `destroyTelnyxVoipClient()` first.
|
|
196
231
|
*/
|
|
197
232
|
export declare function createTelnyxVoipClient(options?: TelnyxVoipClientOptions): TelnyxVoipClient;
|
|
198
233
|
/**
|
|
199
|
-
*
|
|
234
|
+
* Destroy the shared TelnyxVoipClient instance.
|
|
235
|
+
*
|
|
236
|
+
* Disposes the current singleton so that a subsequent call to
|
|
237
|
+
* `createTelnyxVoipClient()` will create a fresh instance.
|
|
238
|
+
*/
|
|
239
|
+
export declare function destroyTelnyxVoipClient(): void;
|
|
240
|
+
/**
|
|
241
|
+
* Create a new TelnyxVoipClient instance for background push notification handling.
|
|
242
|
+
*
|
|
243
|
+
* Unlike `createTelnyxVoipClient`, this always creates a new instance because
|
|
244
|
+
* background isolates need their own independent client.
|
|
200
245
|
*/
|
|
201
246
|
export declare function createBackgroundTelnyxVoipClient(
|
|
202
247
|
options?: TelnyxVoipClientOptions
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.TelnyxVoipClient = void 0;
|
|
4
4
|
exports.createTelnyxVoipClient = createTelnyxVoipClient;
|
|
5
|
+
exports.destroyTelnyxVoipClient = destroyTelnyxVoipClient;
|
|
5
6
|
exports.createBackgroundTelnyxVoipClient = createBackgroundTelnyxVoipClient;
|
|
6
7
|
const connection_state_1 = require('./models/connection-state');
|
|
8
|
+
const call_state_1 = require('./models/call-state');
|
|
7
9
|
const config_1 = require('./models/config');
|
|
8
10
|
const session_manager_1 = require('./internal/session/session-manager');
|
|
9
11
|
const call_state_controller_1 = require('./internal/calls/call-state-controller');
|
|
12
|
+
const voice_pn_bridge_1 = require('./internal/voice-pn-bridge');
|
|
10
13
|
/**
|
|
11
14
|
* The main public interface for the react-voice-commons module.
|
|
12
15
|
*
|
|
@@ -19,6 +22,26 @@ const call_state_controller_1 = require('./internal/calls/call-state-controller'
|
|
|
19
22
|
* into their chosen state management solution naturally.
|
|
20
23
|
*/
|
|
21
24
|
class TelnyxVoipClient {
|
|
25
|
+
/**
|
|
26
|
+
* Check if the app was launched from a push notification.
|
|
27
|
+
*
|
|
28
|
+
* Use this to avoid double-login on cold start. When true, the SDK will
|
|
29
|
+
* handle login internally via the push notification flow, so you should
|
|
30
|
+
* skip your normal auto-login.
|
|
31
|
+
*
|
|
32
|
+
* @returns true if there is pending push notification data indicating a push-launched app
|
|
33
|
+
*/
|
|
34
|
+
static async isLaunchedFromPushNotification() {
|
|
35
|
+
try {
|
|
36
|
+
const pendingAction = await voice_pn_bridge_1.VoicePnBridge.getPendingPushAction();
|
|
37
|
+
if (pendingAction?.action) return true;
|
|
38
|
+
const pendingVoipPush = await voice_pn_bridge_1.VoicePnBridge.getPendingVoipPush();
|
|
39
|
+
if (pendingVoipPush) return true;
|
|
40
|
+
return false;
|
|
41
|
+
} catch {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
22
45
|
/**
|
|
23
46
|
* Creates a new TelnyxVoipClient instance.
|
|
24
47
|
*
|
|
@@ -97,6 +120,35 @@ class TelnyxVoipClient {
|
|
|
97
120
|
get currentActiveCall() {
|
|
98
121
|
return this._callStateController.currentActiveCall;
|
|
99
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Check if there are any active calls (not in ENDED or FAILED state).
|
|
125
|
+
* Matches TelnyxRTC `hasActiveCalls` property for multi-call support.
|
|
126
|
+
*/
|
|
127
|
+
get hasActiveCalls() {
|
|
128
|
+
return this.currentCalls.some(
|
|
129
|
+
(call) =>
|
|
130
|
+
call.currentState !== call_state_1.TelnyxCallState.ENDED &&
|
|
131
|
+
call.currentState !== call_state_1.TelnyxCallState.FAILED
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Access any active call tracked by the client.
|
|
136
|
+
* A call will be accessible until it has ended (transitioned to the ENDED state).
|
|
137
|
+
* This matches the TelnyxRTC `getCall(callId)` method for multi-call support.
|
|
138
|
+
*
|
|
139
|
+
* @param callId The unique identifier of a call.
|
|
140
|
+
* @returns The Call object that matches the requested callId, or null if not found.
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* const call = voipClient.getCall('some-call-uuid');
|
|
144
|
+
* if (call) {
|
|
145
|
+
* console.log('Call state:', call.currentState);
|
|
146
|
+
* }
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
getCall(callId) {
|
|
150
|
+
return this._callStateController.getCall(callId);
|
|
151
|
+
}
|
|
100
152
|
/**
|
|
101
153
|
* Current session ID (UUID) for this connection.
|
|
102
154
|
*/
|
|
@@ -440,14 +492,38 @@ class TelnyxVoipClient {
|
|
|
440
492
|
}
|
|
441
493
|
exports.TelnyxVoipClient = TelnyxVoipClient;
|
|
442
494
|
// ========== Factory Functions ==========
|
|
495
|
+
let _sharedInstance = null;
|
|
443
496
|
/**
|
|
444
|
-
* Create
|
|
497
|
+
* Create or retrieve the shared TelnyxVoipClient instance.
|
|
498
|
+
*
|
|
499
|
+
* This uses a singleton pattern — calling it multiple times (e.g., inside a
|
|
500
|
+
* React component body) always returns the same instance. If you need to
|
|
501
|
+
* reset the instance, call `destroyTelnyxVoipClient()` first.
|
|
445
502
|
*/
|
|
446
503
|
function createTelnyxVoipClient(options) {
|
|
447
|
-
|
|
504
|
+
if (_sharedInstance) {
|
|
505
|
+
return _sharedInstance;
|
|
506
|
+
}
|
|
507
|
+
_sharedInstance = new TelnyxVoipClient(options);
|
|
508
|
+
return _sharedInstance;
|
|
448
509
|
}
|
|
449
510
|
/**
|
|
450
|
-
*
|
|
511
|
+
* Destroy the shared TelnyxVoipClient instance.
|
|
512
|
+
*
|
|
513
|
+
* Disposes the current singleton so that a subsequent call to
|
|
514
|
+
* `createTelnyxVoipClient()` will create a fresh instance.
|
|
515
|
+
*/
|
|
516
|
+
function destroyTelnyxVoipClient() {
|
|
517
|
+
if (_sharedInstance) {
|
|
518
|
+
_sharedInstance.dispose();
|
|
519
|
+
_sharedInstance = null;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Create a new TelnyxVoipClient instance for background push notification handling.
|
|
524
|
+
*
|
|
525
|
+
* Unlike `createTelnyxVoipClient`, this always creates a new instance because
|
|
526
|
+
* background isolates need their own independent client.
|
|
451
527
|
*/
|
|
452
528
|
function createBackgroundTelnyxVoipClient(options) {
|
|
453
529
|
return new TelnyxVoipClient(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telnyx/react-voice-commons-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7-beta.1",
|
|
4
4
|
"description": "A high-level, state-agnostic, drop-in module for the Telnyx React Native SDK that simplifies WebRTC voice calling integration",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"lib",
|
|
19
19
|
"src",
|
|
20
|
-
"android",
|
|
20
|
+
"android/src",
|
|
21
|
+
"android/build.gradle",
|
|
21
22
|
"ios",
|
|
22
23
|
"TelnyxVoiceCommons.podspec",
|
|
23
24
|
"README.md",
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
],
|
|
26
27
|
"scripts": {
|
|
27
28
|
"build": "tsc",
|
|
29
|
+
"postbuild": "prettier --write --ignore-path /dev/null \"lib/**/*.{js,ts}\"",
|
|
28
30
|
"dev": "tsc --watch",
|
|
29
31
|
"test": "jest",
|
|
30
32
|
"test:watch": "jest --watch",
|
|
@@ -326,6 +326,14 @@ class CallKitCoordinator {
|
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
+
if (this.endedCalls.has(callKitUUID)) {
|
|
330
|
+
console.log('CallKitCoordinator: Call already ended, skipping duplicate end action');
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Mark as ended immediately to prevent any duplicate processing
|
|
335
|
+
this.endedCalls.add(callKitUUID);
|
|
336
|
+
|
|
329
337
|
const call = this.callMap.get(callKitUUID);
|
|
330
338
|
|
|
331
339
|
if (!call) {
|
|
@@ -648,9 +656,7 @@ class CallKitCoordinator {
|
|
|
648
656
|
* Clean up call mappings and listeners
|
|
649
657
|
*/
|
|
650
658
|
private cleanupCall(callKitUUID: string) {
|
|
651
|
-
// Remove from all tracking sets
|
|
652
659
|
this.processingCalls.delete(callKitUUID);
|
|
653
|
-
this.endedCalls.delete(callKitUUID);
|
|
654
660
|
this.connectedCalls.delete(callKitUUID);
|
|
655
661
|
|
|
656
662
|
// Get the call before removing it
|
|
@@ -734,7 +740,10 @@ class CallKitCoordinator {
|
|
|
734
740
|
}
|
|
735
741
|
|
|
736
742
|
/**
|
|
737
|
-
* Set the VoIP client reference for triggering reconnection
|
|
743
|
+
* Set the VoIP client reference for triggering reconnection.
|
|
744
|
+
*
|
|
745
|
+
* @deprecated No longer needed — TelnyxVoiceApp now auto-wires the voipClient
|
|
746
|
+
* on mount. Kept for backwards compatibility.
|
|
738
747
|
*/
|
|
739
748
|
setVoipClient(voipClient: TelnyxVoipClient): void {
|
|
740
749
|
this.voipClient = voipClient;
|
|
@@ -42,6 +42,11 @@ export function useCallKitCoordinator() {
|
|
|
42
42
|
return callKitCoordinator.isAvailable();
|
|
43
43
|
}, []);
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated No longer needed — TelnyxVoiceApp now auto-wires the voipClient
|
|
47
|
+
* on the CallKit coordinator when it receives the voipClient prop.
|
|
48
|
+
* This method is kept for backwards compatibility and will be removed in a future release.
|
|
49
|
+
*/
|
|
45
50
|
const setVoipClient = useCallback((voipClient: TelnyxVoipClient): void => {
|
|
46
51
|
callKitCoordinator.setVoipClient(voipClient);
|
|
47
52
|
}, []);
|