@telnyx/react-voice-commons-sdk 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/android/build/.transforms/35d64beab84343a7420320f8057c40b9/results.bin +1 -0
- package/android/build/.transforms/35d64beab84343a7420320f8057c40b9/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/results.bin +1 -0
- 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 +1 -0
- package/android/build/.transforms/8ebc6907344eccd2b9c23d903854d4fb/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/results.bin +1 -0
- 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 +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +42 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- 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 +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- 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 +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +75 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +42 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- 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 +1 -0
- 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 +2 -0
- 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 +82 -0
- 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/build.gradle +45 -0
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +38 -0
- package/android/src/main/java/com/telnyx/react_voice_commons/CallForegroundService.kt +83 -0
- package/android/src/main/java/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.kt +179 -0
- package/android/src/main/java/com/telnyx/react_voice_commons/TelnyxMainActivity.kt +216 -0
- package/android/src/main/java/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.kt +177 -0
- package/android/src/main/java/com/telnyx/react_voice_commons/TelnyxNotificationHelper.kt +277 -0
- package/android/src/main/java/com/telnyx/react_voice_commons/VoicePnBridgeModule.kt +247 -0
- package/android/src/main/java/com/telnyx/react_voice_commons/VoicePnBridgePackage.kt +17 -0
- package/android/src/main/java/com/telnyx/react_voice_commons/VoicePnManager.kt +154 -0
- package/package.json +2 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
package com.telnyx.react_voice_commons
|
|
2
|
+
|
|
3
|
+
import android.content.Intent
|
|
4
|
+
import android.os.Build
|
|
5
|
+
import android.os.Bundle
|
|
6
|
+
import android.util.Log
|
|
7
|
+
import androidx.annotation.RequiresApi
|
|
8
|
+
import com.facebook.react.ReactActivity
|
|
9
|
+
import com.facebook.react.ReactApplication
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Base MainActivity class that provides Telnyx voice push notification handling
|
|
13
|
+
* Your app's MainActivity should extend this class to get Telnyx functionality
|
|
14
|
+
*/
|
|
15
|
+
abstract class TelnyxMainActivity : ReactActivity() {
|
|
16
|
+
companion object {
|
|
17
|
+
private const val TAG = "TelnyxMainActivity"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Store pending push notification data
|
|
21
|
+
private var pendingPushAction: String? = null
|
|
22
|
+
private var pendingPushMetadata: String? = null
|
|
23
|
+
|
|
24
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
25
|
+
super.onCreate(savedInstanceState)
|
|
26
|
+
// Handle any intent extras (from push notifications or deep links)
|
|
27
|
+
handleIntent(intent)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun onNewIntent(intent: Intent?) {
|
|
31
|
+
super.onNewIntent(intent)
|
|
32
|
+
Log.d(TAG, "onNewIntent called")
|
|
33
|
+
intent?.let { handleIntent(it) }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
override fun onResume() {
|
|
37
|
+
super.onResume()
|
|
38
|
+
Log.d(TAG, "onResume called")
|
|
39
|
+
// Check and send any pending push actions when app resumes
|
|
40
|
+
checkAndSendPendingPushAction()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Handle incoming intent data (from push notifications, deep links, etc.)
|
|
45
|
+
*/
|
|
46
|
+
@RequiresApi(Build.VERSION_CODES.O)
|
|
47
|
+
private fun handleIntent(intent: Intent) {
|
|
48
|
+
Log.d(TAG, "Handling intent: ${intent.action}")
|
|
49
|
+
|
|
50
|
+
val extras = intent.extras
|
|
51
|
+
if (extras != null) {
|
|
52
|
+
Log.d(TAG, "Intent extras found: ${extras.keySet()}")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
// Handle push notification data
|
|
56
|
+
val callId = extras.getString("call_id")
|
|
57
|
+
val action = extras.getString("action")
|
|
58
|
+
val fromNotificationAction = extras.getBoolean("from_notification_action", false)
|
|
59
|
+
val metadata = extras.getString("meta_data")
|
|
60
|
+
if (callId != null && action != null) {
|
|
61
|
+
Log.d(TAG, "Found push notification data - callId: $callId, action: $action, fromNotificationAction: $fromNotificationAction")
|
|
62
|
+
|
|
63
|
+
// If this was opened from a notification action, handle it appropriately
|
|
64
|
+
if (fromNotificationAction) {
|
|
65
|
+
Log.d(TAG, "App opened from notification action - action: $action")
|
|
66
|
+
|
|
67
|
+
when (action) {
|
|
68
|
+
"answer" -> {
|
|
69
|
+
Log.d(TAG, "User answered call - showing ongoing call notification")
|
|
70
|
+
// Dismiss incoming call notification
|
|
71
|
+
TelnyxNotificationHelper.hideNotificationFromContext(this)
|
|
72
|
+
|
|
73
|
+
// Show ongoing call notification to keep app alive
|
|
74
|
+
val callerName = extras.getString("caller_name") ?: extras.getString("caller_id_name") ?: "Unknown Caller"
|
|
75
|
+
val callerNumber = extras.getString("caller_number") ?: extras.getString("caller_id_number") ?: ""
|
|
76
|
+
|
|
77
|
+
val notificationHelper = TelnyxNotificationHelper(this)
|
|
78
|
+
notificationHelper.showOngoingCallNotification(callerName, callerNumber, callId)
|
|
79
|
+
|
|
80
|
+
// Start foreground service to keep WebRTC connection alive
|
|
81
|
+
try {
|
|
82
|
+
val serviceIntent = Intent(this, CallForegroundService::class.java).apply {
|
|
83
|
+
setAction(CallForegroundService.ACTION_START_FOREGROUND_SERVICE)
|
|
84
|
+
putExtra(CallForegroundService.EXTRA_CALLER_NAME, callerName)
|
|
85
|
+
putExtra(CallForegroundService.EXTRA_CALLER_NUMBER, callerNumber)
|
|
86
|
+
putExtra(CallForegroundService.EXTRA_CALL_ID, callId)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Use startForegroundService for API 26+, startService for older versions
|
|
90
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
91
|
+
startForegroundService(serviceIntent)
|
|
92
|
+
} else {
|
|
93
|
+
startService(serviceIntent)
|
|
94
|
+
}
|
|
95
|
+
Log.d(TAG, "Started CallForegroundService for answered call")
|
|
96
|
+
} catch (e: Exception) {
|
|
97
|
+
Log.e(TAG, "Failed to start CallForegroundService", e)
|
|
98
|
+
// Continue without foreground service if it fails
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
"reject", "hangup" -> {
|
|
102
|
+
Log.d(TAG, "User rejected/ended call - dismissing all notifications")
|
|
103
|
+
// Dismiss any call notifications
|
|
104
|
+
TelnyxNotificationHelper.hideNotificationFromContext(this)
|
|
105
|
+
}
|
|
106
|
+
else -> {
|
|
107
|
+
Log.d(TAG, "Unknown notification action, dismissing notification")
|
|
108
|
+
TelnyxNotificationHelper.hideNotificationFromContext(this)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Store the push action for when React Native is ready
|
|
114
|
+
pendingPushAction = action
|
|
115
|
+
pendingPushMetadata = metadata
|
|
116
|
+
|
|
117
|
+
// Store the call action for React Native to retrieve
|
|
118
|
+
notifyReactNativeOfCallAction(action!!, callId!!)
|
|
119
|
+
|
|
120
|
+
// Also store as push action for backward compatibility
|
|
121
|
+
checkAndSendPendingPushAction()
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Allow subclasses to handle additional intent processing
|
|
126
|
+
onHandleIntent(intent)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Create push metadata string from intent extras
|
|
131
|
+
*/
|
|
132
|
+
private fun createPushMetadata(callId: String, action: String, extras: Bundle): String {
|
|
133
|
+
val metadata = mutableMapOf<String, String>()
|
|
134
|
+
metadata["call_id"] = callId
|
|
135
|
+
metadata["action"] = action
|
|
136
|
+
|
|
137
|
+
// Add any other relevant extras
|
|
138
|
+
extras.getString("caller_name")?.let { metadata["caller_name"] = it }
|
|
139
|
+
extras.getString("caller_number")?.let { metadata["caller_number"] = it }
|
|
140
|
+
extras.getString("caller_id_name")?.let { metadata["caller_id_name"] = it }
|
|
141
|
+
extras.getString("caller_id_number")?.let { metadata["caller_id_number"] = it }
|
|
142
|
+
|
|
143
|
+
return metadata.toString()
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Check and send pending push action to React Native via VoicePnModule
|
|
148
|
+
* This method is called via reflection from VoicePnModule
|
|
149
|
+
*/
|
|
150
|
+
fun checkAndSendPendingPushAction(): Boolean {
|
|
151
|
+
Log.d(TAG, "checkAndSendPendingPushAction called")
|
|
152
|
+
// Fallback: handle instance variables (from intent extras)
|
|
153
|
+
if (pendingPushAction != null && pendingPushMetadata != null) {
|
|
154
|
+
Log.d(TAG, "Found instance push action: $pendingPushAction")
|
|
155
|
+
|
|
156
|
+
try {
|
|
157
|
+
// Store the intent-based action in VoicePnManager
|
|
158
|
+
VoicePnManager.setPendingPushAction(this, pendingPushAction!!, pendingPushMetadata!!)
|
|
159
|
+
|
|
160
|
+
// Clear the pending action
|
|
161
|
+
pendingPushAction = null
|
|
162
|
+
pendingPushMetadata = null
|
|
163
|
+
|
|
164
|
+
Log.d(TAG, "Instance push action stored successfully")
|
|
165
|
+
return true
|
|
166
|
+
} catch (e: Exception) {
|
|
167
|
+
Log.e(TAG, "Error storing instance push action", e)
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
Log.d(TAG, "No pending push action found")
|
|
172
|
+
return false
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Notify React Native of call actions that happen from notification buttons
|
|
177
|
+
*/
|
|
178
|
+
private fun notifyReactNativeOfCallAction(action: String, callId: String) {
|
|
179
|
+
try {
|
|
180
|
+
Log.d(TAG, "Notifying React Native of call action: $action for callId: $callId")
|
|
181
|
+
|
|
182
|
+
// Store the call action using VoicePnManager for reliable retrieval (fallback)
|
|
183
|
+
VoicePnManager.setPendingCallAction(this, action, callId, System.currentTimeMillis())
|
|
184
|
+
|
|
185
|
+
// Send immediate event to React Native if available (for active calls)
|
|
186
|
+
try {
|
|
187
|
+
val reactApplication = application as? ReactApplication
|
|
188
|
+
val reactContext = reactApplication?.reactNativeHost?.reactInstanceManager?.currentReactContext
|
|
189
|
+
|
|
190
|
+
if (reactContext != null) {
|
|
191
|
+
Log.d(TAG, "React Native context available, emitting immediate call action event")
|
|
192
|
+
|
|
193
|
+
// Use VoicePnBridgeModule to emit the event
|
|
194
|
+
val bridgeModule = reactContext.getNativeModule(VoicePnBridgeModule::class.java)
|
|
195
|
+
bridgeModule?.emitCallActionEvent(action, callId)
|
|
196
|
+
} else {
|
|
197
|
+
Log.d(TAG, "React Native context not available, action stored for later retrieval")
|
|
198
|
+
}
|
|
199
|
+
} catch (e: Exception) {
|
|
200
|
+
Log.e(TAG, "Error emitting immediate call action event", e)
|
|
201
|
+
// Action is still stored in VoicePnManager as fallback
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
Log.d(TAG, "Call action notification completed: $action")
|
|
205
|
+
} catch (e: Exception) {
|
|
206
|
+
Log.e(TAG, "Error notifying React Native of call action", e)
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Override this method in your MainActivity to handle additional intent processing
|
|
212
|
+
*/
|
|
213
|
+
protected open fun onHandleIntent(intent: Intent) {
|
|
214
|
+
// Default implementation does nothing
|
|
215
|
+
}
|
|
216
|
+
}
|
package/android/src/main/java/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.kt
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
package com.telnyx.react_voice_commons
|
|
2
|
+
|
|
3
|
+
import android.content.BroadcastReceiver
|
|
4
|
+
import android.content.Context
|
|
5
|
+
import android.content.Intent
|
|
6
|
+
import android.util.Log
|
|
7
|
+
import org.json.JSONObject
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Base broadcast receiver for handling notification actions for Telnyx voice calls (Answer/Reject)
|
|
11
|
+
* Your app should extend this class to customize behavior if needed
|
|
12
|
+
*/
|
|
13
|
+
open class TelnyxNotificationActionReceiver : BroadcastReceiver() {
|
|
14
|
+
private val tag = "TelnyxNotification"
|
|
15
|
+
|
|
16
|
+
override fun onReceive(context: Context, intent: Intent) {
|
|
17
|
+
val action = intent.action
|
|
18
|
+
val callId = intent.getStringExtra("call_id")
|
|
19
|
+
|
|
20
|
+
Log.d(tag, "Received notification action: $action for call: $callId")
|
|
21
|
+
|
|
22
|
+
if (callId == null) {
|
|
23
|
+
Log.e(tag, "No call ID provided in notification action")
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
when (action) {
|
|
28
|
+
"ANSWER_CALL" -> {
|
|
29
|
+
Log.d(tag, "Answer action triggered for call: $callId")
|
|
30
|
+
handleAnswerCall(context, callId)
|
|
31
|
+
}
|
|
32
|
+
"REJECT_CALL" -> {
|
|
33
|
+
Log.d(tag, "Reject action triggered for call: $callId")
|
|
34
|
+
handleRejectCall(context, callId)
|
|
35
|
+
}
|
|
36
|
+
else -> {
|
|
37
|
+
Log.w(tag, "Unknown notification action: $action")
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Hide the notification after action
|
|
42
|
+
val notificationHelper = TelnyxNotificationHelper(context)
|
|
43
|
+
notificationHelper.hideIncomingCallNotification()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
protected open fun handleAnswerCall(context: Context, callId: String) {
|
|
47
|
+
try {
|
|
48
|
+
Log.d(tag, "Processing answer action through VoicePnManager")
|
|
49
|
+
|
|
50
|
+
// Get the existing metadata from VoicePnManager (contains original FCM data including voice_sdk_id)
|
|
51
|
+
val (existingAction, existingMetadata) = VoicePnManager.getPendingPushAction(context)
|
|
52
|
+
|
|
53
|
+
Log.d(tag, "Existing action: '$existingAction'")
|
|
54
|
+
Log.d(tag, "Existing metadata: '$existingMetadata'")
|
|
55
|
+
Log.d(tag, "Existing metadata length: ${existingMetadata?.length ?: 0}")
|
|
56
|
+
|
|
57
|
+
var finalMetadata: String
|
|
58
|
+
|
|
59
|
+
if (existingMetadata != null && existingMetadata.isNotEmpty()) {
|
|
60
|
+
// Try to parse existing metadata and add action info
|
|
61
|
+
try {
|
|
62
|
+
Log.d(tag, "Attempting to preserve original metadata")
|
|
63
|
+
|
|
64
|
+
// The existing metadata from FCM service is the raw FCM data string
|
|
65
|
+
// It looks like: {metadata={"call_id":"...","voice_sdk_id":"..."}, message=...}
|
|
66
|
+
if (existingMetadata.contains("\"voice_sdk_id\"")) {
|
|
67
|
+
// Extract just the JSON part that contains the voice_sdk_id
|
|
68
|
+
val startIndex = existingMetadata.indexOf("{\"call_id\"")
|
|
69
|
+
val endIndex = existingMetadata.lastIndexOf("}") + 1
|
|
70
|
+
|
|
71
|
+
if (startIndex in 0..<endIndex) {
|
|
72
|
+
val originalJson = existingMetadata.substring(startIndex, endIndex)
|
|
73
|
+
Log.d(tag, "Extracted original JSON: $originalJson")
|
|
74
|
+
|
|
75
|
+
// Parse and add action
|
|
76
|
+
val metadata = JSONObject(originalJson)
|
|
77
|
+
metadata.put("action", "answer")
|
|
78
|
+
finalMetadata = metadata.toString()
|
|
79
|
+
|
|
80
|
+
Log.d(tag, "Enhanced metadata with action: $finalMetadata")
|
|
81
|
+
} else {
|
|
82
|
+
throw Exception("Could not extract JSON from FCM data")
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
// Try to parse as direct JSON and add action
|
|
86
|
+
val metadata = JSONObject(existingMetadata)
|
|
87
|
+
metadata.put("action", "answer")
|
|
88
|
+
finalMetadata = metadata.toString()
|
|
89
|
+
|
|
90
|
+
Log.d(tag, "Updated existing JSON metadata with action: $finalMetadata")
|
|
91
|
+
}
|
|
92
|
+
} catch (e: Exception) {
|
|
93
|
+
Log.w(tag, "Could not parse existing metadata, creating new one", e)
|
|
94
|
+
// Fallback to simple metadata
|
|
95
|
+
finalMetadata = JSONObject().apply {
|
|
96
|
+
put("call_id", callId)
|
|
97
|
+
put("action", "answer")
|
|
98
|
+
}.toString()
|
|
99
|
+
Log.d(tag, "Created fallback metadata: $finalMetadata")
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
// No existing metadata, create simple one
|
|
103
|
+
Log.d(tag, "No existing metadata found, creating simple metadata")
|
|
104
|
+
finalMetadata = JSONObject().apply {
|
|
105
|
+
put("call_id", callId)
|
|
106
|
+
put("action", "answer")
|
|
107
|
+
}.toString()
|
|
108
|
+
Log.d(tag, "Created simple metadata: $finalMetadata")
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
VoicePnManager.setPendingPushAction(context, "answer", finalMetadata)
|
|
112
|
+
|
|
113
|
+
Log.d(tag, "Answer action stored - app should open via direct PendingIntent")
|
|
114
|
+
} catch (e: Exception) {
|
|
115
|
+
Log.e(tag, "Error handling answer call action", e)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
protected open fun handleRejectCall(context: Context, callId: String) {
|
|
120
|
+
try {
|
|
121
|
+
Log.d(tag, "Processing reject action through VoicePnManager")
|
|
122
|
+
|
|
123
|
+
// Get the existing metadata from VoicePnManager (contains original FCM data including voice_sdk_id)
|
|
124
|
+
val (existingAction, existingMetadata) = VoicePnManager.getPendingPushAction(context)
|
|
125
|
+
|
|
126
|
+
var finalMetadata: String
|
|
127
|
+
|
|
128
|
+
if (existingMetadata != null && existingMetadata.isNotEmpty()) {
|
|
129
|
+
// Try to parse existing metadata and add action info
|
|
130
|
+
try {
|
|
131
|
+
// The existing metadata might be FCM data string or JSON
|
|
132
|
+
if (existingMetadata.startsWith("{") && existingMetadata.contains("metadata=")) {
|
|
133
|
+
// This is FCM data string format: {metadata={"call_id":"...","voice_sdk_id":"..."}, message=...}
|
|
134
|
+
// Extract the JSON part from metadata field
|
|
135
|
+
val metadataStart = existingMetadata.indexOf("metadata=") + 9
|
|
136
|
+
val metadataEnd = existingMetadata.indexOf("}", metadataStart) + 1
|
|
137
|
+
val metadataJson = existingMetadata.substring(metadataStart, metadataEnd)
|
|
138
|
+
|
|
139
|
+
// Parse and add action
|
|
140
|
+
val metadata = JSONObject(metadataJson)
|
|
141
|
+
metadata.put("action", "reject")
|
|
142
|
+
finalMetadata = metadata.toString()
|
|
143
|
+
|
|
144
|
+
Log.d(tag, "Preserved original FCM metadata with action: $finalMetadata")
|
|
145
|
+
} else {
|
|
146
|
+
// Try to parse as direct JSON
|
|
147
|
+
val metadata = JSONObject(existingMetadata)
|
|
148
|
+
metadata.put("action", "reject")
|
|
149
|
+
finalMetadata = metadata.toString()
|
|
150
|
+
|
|
151
|
+
Log.d(tag, "Updated existing JSON metadata with action: $finalMetadata")
|
|
152
|
+
}
|
|
153
|
+
} catch (e: Exception) {
|
|
154
|
+
Log.w(tag, "Could not parse existing metadata, creating new one", e)
|
|
155
|
+
// Fallback to simple metadata
|
|
156
|
+
finalMetadata = mapOf(
|
|
157
|
+
"call_id" to callId,
|
|
158
|
+
"action" to "reject"
|
|
159
|
+
).toString()
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
// No existing metadata, create simple one
|
|
163
|
+
Log.d(tag, "No existing metadata found, creating simple metadata")
|
|
164
|
+
finalMetadata = mapOf(
|
|
165
|
+
"call_id" to callId,
|
|
166
|
+
"action" to "reject"
|
|
167
|
+
).toString()
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
VoicePnManager.setPendingPushAction(context, "reject", finalMetadata)
|
|
171
|
+
|
|
172
|
+
Log.d(tag, "Reject action processed successfully")
|
|
173
|
+
} catch (e: Exception) {
|
|
174
|
+
Log.e(tag, "Error handling reject call action", e)
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
package com.telnyx.react_voice_commons
|
|
2
|
+
|
|
3
|
+
import android.app.Notification
|
|
4
|
+
import android.app.NotificationChannel
|
|
5
|
+
import android.app.NotificationManager
|
|
6
|
+
import android.app.PendingIntent
|
|
7
|
+
import android.content.Context
|
|
8
|
+
import android.content.Intent
|
|
9
|
+
import android.os.Build
|
|
10
|
+
import androidx.core.app.NotificationCompat
|
|
11
|
+
import android.graphics.Color
|
|
12
|
+
import android.util.Log
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Helper class for managing Telnyx voice call notifications
|
|
16
|
+
*/
|
|
17
|
+
class TelnyxNotificationHelper(private val context: Context) {
|
|
18
|
+
companion object {
|
|
19
|
+
const val CHANNEL_ID = "telnyx_voice_calls"
|
|
20
|
+
const val CHANNEL_NAME = "Telnyx Voice Calls"
|
|
21
|
+
const val NOTIFICATION_ID = 1001
|
|
22
|
+
const val ONGOING_CALL_NOTIFICATION_ID = 1002
|
|
23
|
+
private const val TAG = "TelnyxNotifications"
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Static method to hide notifications from anywhere in the app
|
|
27
|
+
* Useful for dismissing notifications when the app opens from Answer button
|
|
28
|
+
*/
|
|
29
|
+
fun hideNotificationFromContext(context: Context) {
|
|
30
|
+
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
|
31
|
+
notificationManager.cancel(NOTIFICATION_ID)
|
|
32
|
+
Log.d(TAG, "Dismissed Telnyx notification from static context")
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Static method to hide ongoing call notification from anywhere in the app
|
|
37
|
+
* Should be called when a call ends to dismiss the ongoing call notification
|
|
38
|
+
*/
|
|
39
|
+
fun hideOngoingCallNotificationFromContext(context: Context) {
|
|
40
|
+
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
|
41
|
+
notificationManager.cancel(ONGOING_CALL_NOTIFICATION_ID)
|
|
42
|
+
Log.d(TAG, "Dismissed ongoing call notification from static context")
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
|
47
|
+
|
|
48
|
+
init {
|
|
49
|
+
createNotificationChannel()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private fun createNotificationChannel() {
|
|
53
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
54
|
+
val channel = NotificationChannel(
|
|
55
|
+
CHANNEL_ID,
|
|
56
|
+
CHANNEL_NAME,
|
|
57
|
+
NotificationManager.IMPORTANCE_HIGH
|
|
58
|
+
).apply {
|
|
59
|
+
description = "Notifications for incoming Telnyx voice calls"
|
|
60
|
+
enableLights(true)
|
|
61
|
+
lightColor = Color.GREEN
|
|
62
|
+
enableVibration(true)
|
|
63
|
+
setSound(null, null) // Disable sound, CallKit will handle audio
|
|
64
|
+
}
|
|
65
|
+
notificationManager.createNotificationChannel(channel)
|
|
66
|
+
Log.d(TAG, "Created notification channel: $CHANNEL_ID")
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
fun createIncomingCallNotification(
|
|
71
|
+
callerName: String?,
|
|
72
|
+
callerNumber: String?,
|
|
73
|
+
callId: String,
|
|
74
|
+
metadata: String,
|
|
75
|
+
mainActivityClass: Class<*>? = null
|
|
76
|
+
): Notification {
|
|
77
|
+
val displayName = callerName ?: callerNumber ?: "Unknown Caller"
|
|
78
|
+
val displayNumber = if (callerName != null && callerNumber != null) callerNumber else ""
|
|
79
|
+
|
|
80
|
+
// Use provided MainActivity class or try to find it dynamically
|
|
81
|
+
val activityClass = mainActivityClass ?: try {
|
|
82
|
+
// Try TelnyxMainActivity first (apps should extend this)
|
|
83
|
+
Class.forName("${context.packageName}.TelnyxMainActivity")
|
|
84
|
+
} catch (e1: Exception) {
|
|
85
|
+
try {
|
|
86
|
+
// Fallback to MainActivity
|
|
87
|
+
Class.forName("${context.packageName}.MainActivity")
|
|
88
|
+
} catch (e2: Exception) {
|
|
89
|
+
Log.w(TAG, "Could not find TelnyxMainActivity or MainActivity, using context class", e2)
|
|
90
|
+
context.javaClass
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Intent to open the app when notification is tapped
|
|
95
|
+
val appIntent = Intent(context, activityClass).apply {
|
|
96
|
+
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
|
97
|
+
putExtra("call_id", callId)
|
|
98
|
+
putExtra("action", "open_call")
|
|
99
|
+
}
|
|
100
|
+
val appPendingIntent = PendingIntent.getActivity(
|
|
101
|
+
context, 0, appIntent,
|
|
102
|
+
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
val builder = NotificationCompat.Builder(context, CHANNEL_ID)
|
|
106
|
+
.setContentTitle("Incoming Call")
|
|
107
|
+
.setContentText("$displayName")
|
|
108
|
+
.setSmallIcon(android.R.drawable.ic_menu_call)
|
|
109
|
+
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
|
110
|
+
.setCategory(NotificationCompat.CATEGORY_CALL)
|
|
111
|
+
.setAutoCancel(true)
|
|
112
|
+
.setOngoing(true)
|
|
113
|
+
.setFullScreenIntent(appPendingIntent, true)
|
|
114
|
+
.setContentIntent(appPendingIntent)
|
|
115
|
+
.setColor(Color.GREEN)
|
|
116
|
+
|
|
117
|
+
// Add action buttons - use direct activity PendingIntents to avoid trampoline restrictions
|
|
118
|
+
// Answer action - direct activity launch to avoid BAL restrictions
|
|
119
|
+
val answerActivityIntent = Intent(context, activityClass).apply {
|
|
120
|
+
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
|
121
|
+
putExtra("call_id", callId)
|
|
122
|
+
putExtra("action", "answer")
|
|
123
|
+
putExtra("from_notification_action", true)
|
|
124
|
+
putExtra("meta_data", metadata)
|
|
125
|
+
putExtra("caller_name", callerName)
|
|
126
|
+
putExtra("caller_number", callerNumber)
|
|
127
|
+
}
|
|
128
|
+
val answerPendingIntent = PendingIntent.getActivity(
|
|
129
|
+
context, 1, answerActivityIntent,
|
|
130
|
+
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
// Reject action - direct activity launch to avoid BAL restrictions
|
|
134
|
+
val rejectActivityIntent = Intent(context, activityClass).apply {
|
|
135
|
+
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
|
136
|
+
putExtra("call_id", callId)
|
|
137
|
+
putExtra("action", "reject")
|
|
138
|
+
putExtra("from_notification_action", true)
|
|
139
|
+
putExtra("meta_data",metadata)
|
|
140
|
+
}
|
|
141
|
+
val rejectPendingIntent = PendingIntent.getActivity(
|
|
142
|
+
context, 2, rejectActivityIntent,
|
|
143
|
+
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
builder.addAction(android.R.drawable.ic_menu_call, "Answer", answerPendingIntent)
|
|
147
|
+
builder.addAction(android.R.drawable.ic_menu_close_clear_cancel, "Reject", rejectPendingIntent)
|
|
148
|
+
|
|
149
|
+
return builder.build()
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
fun showIncomingCallNotification(
|
|
153
|
+
callerName: String?,
|
|
154
|
+
callerNumber: String?,
|
|
155
|
+
callId: String,
|
|
156
|
+
metadata: String,
|
|
157
|
+
mainActivityClass: Class<*>? = null,
|
|
158
|
+
) {
|
|
159
|
+
// First, hide any existing notification to avoid conflicts
|
|
160
|
+
hideIncomingCallNotification()
|
|
161
|
+
|
|
162
|
+
val notification = createIncomingCallNotification(callerName, callerNumber, callId,metadata, mainActivityClass)
|
|
163
|
+
notificationManager.notify(NOTIFICATION_ID, notification)
|
|
164
|
+
Log.d(TAG, "Showed incoming call notification for: $callerName ($callerNumber)")
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
fun showMissedCallNotification(
|
|
168
|
+
callerName: String?,
|
|
169
|
+
callerNumber: String?,
|
|
170
|
+
callId: String
|
|
171
|
+
) {
|
|
172
|
+
// Hide any existing incoming call notification first
|
|
173
|
+
hideIncomingCallNotification()
|
|
174
|
+
|
|
175
|
+
val displayName = callerName ?: callerNumber ?: "Unknown Caller"
|
|
176
|
+
val displayNumber = if (callerName != null && callerNumber != null) callerNumber else ""
|
|
177
|
+
|
|
178
|
+
val notification = NotificationCompat.Builder(context, CHANNEL_ID)
|
|
179
|
+
.setContentTitle("Missed Call")
|
|
180
|
+
.setContentText("$displayName${if (displayNumber.isNotEmpty()) "\n$displayNumber" else ""}")
|
|
181
|
+
.setSmallIcon(android.R.drawable.ic_menu_call)
|
|
182
|
+
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
|
|
183
|
+
.setCategory(NotificationCompat.CATEGORY_CALL)
|
|
184
|
+
.setAutoCancel(true)
|
|
185
|
+
.setOngoing(false) // Not ongoing for missed calls
|
|
186
|
+
.setColor(Color.RED)
|
|
187
|
+
.build()
|
|
188
|
+
|
|
189
|
+
notificationManager.notify(NOTIFICATION_ID, notification)
|
|
190
|
+
Log.d(TAG, "Showed missed call notification for: $callerName ($callerNumber)")
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
fun showOngoingCallNotification(
|
|
194
|
+
callerName: String?,
|
|
195
|
+
callerNumber: String?,
|
|
196
|
+
callId: String,
|
|
197
|
+
mainActivityClass: Class<*>? = null
|
|
198
|
+
) {
|
|
199
|
+
val notification = createOngoingCallNotification(callerName, callerNumber, callId, mainActivityClass)
|
|
200
|
+
notificationManager.notify(ONGOING_CALL_NOTIFICATION_ID, notification)
|
|
201
|
+
Log.d(TAG, "Showed ongoing call notification for: $callerName ($callerNumber)")
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Create ongoing call notification (for foreground services)
|
|
206
|
+
* Returns the notification object instead of showing it directly
|
|
207
|
+
*/
|
|
208
|
+
fun createOngoingCallNotification(
|
|
209
|
+
callerName: String?,
|
|
210
|
+
callerNumber: String?,
|
|
211
|
+
callId: String,
|
|
212
|
+
mainActivityClass: Class<*>? = null
|
|
213
|
+
): Notification {
|
|
214
|
+
val displayName = callerName ?: callerNumber ?: "Unknown Caller"
|
|
215
|
+
val displayNumber = if (callerName != null && callerNumber != null) callerNumber else ""
|
|
216
|
+
|
|
217
|
+
// Use provided MainActivity class or try to find it dynamically
|
|
218
|
+
val activityClass = mainActivityClass ?: try {
|
|
219
|
+
// Try TelnyxMainActivity first (apps should extend this)
|
|
220
|
+
Class.forName("${context.packageName}.TelnyxMainActivity")
|
|
221
|
+
} catch (e1: Exception) {
|
|
222
|
+
try {
|
|
223
|
+
// Fallback to MainActivity
|
|
224
|
+
Class.forName("${context.packageName}.MainActivity")
|
|
225
|
+
} catch (e2: Exception) {
|
|
226
|
+
Log.w(TAG, "Could not find TelnyxMainActivity or MainActivity, using context class", e2)
|
|
227
|
+
context.javaClass
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Intent to open the app when notification is tapped
|
|
232
|
+
val appIntent = Intent(context, activityClass).apply {
|
|
233
|
+
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
|
234
|
+
putExtra("call_id", callId)
|
|
235
|
+
putExtra("action", "return_to_call")
|
|
236
|
+
}
|
|
237
|
+
val appPendingIntent = PendingIntent.getActivity(
|
|
238
|
+
context, 0, appIntent,
|
|
239
|
+
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
// End call action
|
|
243
|
+
val endCallIntent = Intent(context, activityClass).apply {
|
|
244
|
+
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
|
|
245
|
+
putExtra("call_id", callId)
|
|
246
|
+
putExtra("action", "hangup")
|
|
247
|
+
putExtra("from_notification_action", true)
|
|
248
|
+
}
|
|
249
|
+
val endCallPendingIntent = PendingIntent.getActivity(
|
|
250
|
+
context, 3, endCallIntent,
|
|
251
|
+
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
return NotificationCompat.Builder(context, CHANNEL_ID)
|
|
255
|
+
.setContentTitle("Ongoing Call")
|
|
256
|
+
.setContentText("$displayName${if (displayNumber.isNotEmpty()) " ($displayNumber)" else ""}")
|
|
257
|
+
.setSmallIcon(android.R.drawable.ic_menu_call)
|
|
258
|
+
.setPriority(NotificationCompat.PRIORITY_LOW) // Low priority for ongoing calls
|
|
259
|
+
.setCategory(NotificationCompat.CATEGORY_CALL)
|
|
260
|
+
.setAutoCancel(false) // Don't auto-cancel ongoing call notifications
|
|
261
|
+
.setOngoing(true) // This is the key - makes it persistent and keeps app alive
|
|
262
|
+
.setContentIntent(appPendingIntent)
|
|
263
|
+
.setColor(Color.GREEN)
|
|
264
|
+
.addAction(android.R.drawable.ic_menu_close_clear_cancel, "End Call", endCallPendingIntent)
|
|
265
|
+
.build()
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
fun hideIncomingCallNotification() {
|
|
269
|
+
notificationManager.cancel(NOTIFICATION_ID)
|
|
270
|
+
Log.d(TAG, "Hid incoming call notification")
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
fun hideOngoingCallNotification() {
|
|
274
|
+
notificationManager.cancel(ONGOING_CALL_NOTIFICATION_ID)
|
|
275
|
+
Log.d(TAG, "Hid ongoing call notification")
|
|
276
|
+
}
|
|
277
|
+
}
|