@stream-io/react-native-callingx 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Callingx.podspec +23 -0
- package/LICENSE +219 -0
- package/README.md +392 -0
- package/android/bin/build/generated/source/buildConfig/debug/io/getstream/rn/callingx/BuildConfig.class +0 -0
- package/android/bin/build/generated/source/codegen/java/io/getstream/rn/callingx/NativeCallingxSpec.class +0 -0
- package/android/bin/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
- package/android/bin/build/generated/source/codegen/jni/CallingxSpec-generated.cpp +167 -0
- package/android/bin/build/generated/source/codegen/jni/CallingxSpec.h +31 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/CallingxSpecJSI-generated.cpp +196 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/CallingxSpecJSI.h +283 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ComponentDescriptors.cpp +22 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ComponentDescriptors.h +24 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/EventEmitters.cpp +16 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/EventEmitters.h +17 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/Props.cpp +19 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/Props.h +18 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ShadowNodes.cpp +17 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/ShadowNodes.h +23 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/States.cpp +16 -0
- package/android/bin/build/generated/source/codegen/jni/react/renderer/components/CallingxSpec/States.h +20 -0
- package/android/bin/build/generated/source/codegen/schema.json +1 -0
- package/android/bin/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +33 -0
- package/android/bin/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/bin/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/bin/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/bin/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/bin/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/bin/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +3 -0
- package/android/bin/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/drawable_ic_phone_paused_24.xml.flat +0 -0
- package/android/bin/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/drawable_ic_round_call_24.xml.flat +0 -0
- package/android/bin/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/drawable_ic_user.xml.flat +0 -0
- package/android/bin/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +4 -0
- package/android/bin/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/bin/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
- package/android/bin/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/bin/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/bin/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/stream-io_react-native-callingx_debug.kotlin_module +0 -0
- package/android/bin/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +5 -0
- package/android/bin/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +60 -0
- package/android/bin/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +33 -0
- package/android/bin/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/bin/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/bin/build/intermediates/packaged_res/debug/packageDebugResources/drawable/ic_phone_paused_24.xml +11 -0
- package/android/bin/build/intermediates/packaged_res/debug/packageDebugResources/drawable/ic_round_call_24.xml +11 -0
- package/android/bin/build/intermediates/packaged_res/debug/packageDebugResources/drawable/ic_user.xml +27 -0
- package/android/bin/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/stream-io_react-native-callingx_debug.kotlin_module +0 -0
- package/android/bin/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/bin/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +4 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.s +1 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
- package/android/bin/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/bin/build/outputs/logs/manifest-merger-debug-report.txt +70 -0
- package/android/bin/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/bin/build/tmp/kotlin-classes/debug/META-INF/stream-io_react-native-callingx_debug.kotlin_module +0 -0
- package/android/bin/build.gradle +81 -0
- package/android/bin/gradle.properties +5 -0
- package/android/bin/local.properties +8 -0
- package/android/bin/src/main/AndroidManifest.xml +30 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/CallService.kt +396 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/CallingxModule.kt +639 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/CallingxPackage.kt +16 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/HeadlessTaskManager.kt +164 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/ResourceUtils.kt +60 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/Utils.kt +23 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/model/Call.kt +57 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/model/CallAction.kt +36 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt +215 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationChannelsManager.kt +113 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationIntentFactory.kt +105 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverActivity.kt +42 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverService.kt +56 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/notifications/NotificationsConfig.kt +116 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/repo/CallRepository.kt +163 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/repo/LegacyCallRepository.kt +134 -0
- package/android/bin/src/main/java/io/getstream/rn/callingx/repo/TelecomCallRepository.kt +438 -0
- package/android/bin/src/main/res/drawable/ic_phone_paused_24.xml +11 -0
- package/android/bin/src/main/res/drawable/ic_round_call_24.xml +11 -0
- package/android/bin/src/main/res/drawable/ic_user.xml +27 -0
- package/android/build.gradle +81 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +30 -0
- package/android/src/main/java/io/getstream/rn/callingx/CallService.kt +396 -0
- package/android/src/main/java/io/getstream/rn/callingx/CallingxModule.kt +639 -0
- package/android/src/main/java/io/getstream/rn/callingx/CallingxPackage.kt +16 -0
- package/android/src/main/java/io/getstream/rn/callingx/HeadlessTaskManager.kt +164 -0
- package/android/src/main/java/io/getstream/rn/callingx/ResourceUtils.kt +60 -0
- package/android/src/main/java/io/getstream/rn/callingx/Utils.kt +23 -0
- package/android/src/main/java/io/getstream/rn/callingx/model/Call.kt +57 -0
- package/android/src/main/java/io/getstream/rn/callingx/model/CallAction.kt +36 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/CallNotificationManager.kt +215 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationChannelsManager.kt +113 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationIntentFactory.kt +105 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverActivity.kt +42 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationReceiverService.kt +56 -0
- package/android/src/main/java/io/getstream/rn/callingx/notifications/NotificationsConfig.kt +116 -0
- package/android/src/main/java/io/getstream/rn/callingx/repo/CallRepository.kt +163 -0
- package/android/src/main/java/io/getstream/rn/callingx/repo/LegacyCallRepository.kt +134 -0
- package/android/src/main/java/io/getstream/rn/callingx/repo/TelecomCallRepository.kt +438 -0
- package/android/src/main/res/drawable/ic_phone_paused_24.xml +11 -0
- package/android/src/main/res/drawable/ic_round_call_24.xml +11 -0
- package/android/src/main/res/drawable/ic_user.xml +27 -0
- package/dist/module/CallingxModule.js +191 -0
- package/dist/module/CallingxModule.js.map +1 -0
- package/dist/module/EventManager.js +40 -0
- package/dist/module/EventManager.js.map +1 -0
- package/dist/module/index.js +5 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/spec/NativeCallingx.js +8 -0
- package/dist/module/spec/NativeCallingx.js.map +1 -0
- package/dist/module/types.js +4 -0
- package/dist/module/types.js.map +1 -0
- package/dist/module/utils/constants.js +48 -0
- package/dist/module/utils/constants.js.map +1 -0
- package/dist/module/utils/headlessTask.js +37 -0
- package/dist/module/utils/headlessTask.js.map +1 -0
- package/dist/module/utils/permissions.js +86 -0
- package/dist/module/utils/permissions.js.map +1 -0
- package/dist/module/utils/types.js +2 -0
- package/dist/module/utils/types.js.map +1 -0
- package/dist/module/utils/utils.js +6 -0
- package/dist/module/utils/utils.js.map +1 -0
- package/dist/typescript/package.json +1 -0
- package/dist/typescript/src/CallingxModule.d.ts +44 -0
- package/dist/typescript/src/CallingxModule.d.ts.map +1 -0
- package/dist/typescript/src/EventManager.d.ts +11 -0
- package/dist/typescript/src/EventManager.d.ts.map +1 -0
- package/dist/typescript/src/index.d.ts +3 -0
- package/dist/typescript/src/index.d.ts.map +1 -0
- package/dist/typescript/src/spec/NativeCallingx.d.ts +132 -0
- package/dist/typescript/src/spec/NativeCallingx.d.ts.map +1 -0
- package/dist/typescript/src/types.d.ts +249 -0
- package/dist/typescript/src/types.d.ts.map +1 -0
- package/dist/typescript/src/utils/constants.d.ts +8 -0
- package/dist/typescript/src/utils/constants.d.ts.map +1 -0
- package/dist/typescript/src/utils/headlessTask.d.ts +8 -0
- package/dist/typescript/src/utils/headlessTask.d.ts.map +1 -0
- package/dist/typescript/src/utils/permissions.d.ts +8 -0
- package/dist/typescript/src/utils/permissions.d.ts.map +1 -0
- package/dist/typescript/src/utils/types.d.ts +4 -0
- package/dist/typescript/src/utils/types.d.ts.map +1 -0
- package/dist/typescript/src/utils/utils.d.ts +2 -0
- package/dist/typescript/src/utils/utils.d.ts.map +1 -0
- package/ios/AudioSessionManager.swift +46 -0
- package/ios/Callingx.mm +280 -0
- package/ios/CallingxImpl.swift +744 -0
- package/ios/CallingxPublic.h +79 -0
- package/ios/Settings.swift +108 -0
- package/ios/UUIDStorage.swift +124 -0
- package/ios/VoipNotificationsManager.swift +180 -0
- package/package.json +112 -0
- package/react-native.config.js +8 -0
- package/src/CallingxModule.ts +321 -0
- package/src/EventManager.ts +61 -0
- package/src/index.ts +2 -0
- package/src/spec/NativeCallingx.ts +176 -0
- package/src/types.ts +323 -0
- package/src/utils/constants.ts +55 -0
- package/src/utils/headlessTask.ts +52 -0
- package/src/utils/permissions.ts +111 -0
- package/src/utils/types.ts +5 -0
- package/src/utils/utils.ts +6 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import <CallKit/CallKit.h>
|
|
3
|
+
|
|
4
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Callingx - React Native Turbo Module for CallKit integration
|
|
8
|
+
*
|
|
9
|
+
* This header exposes the public API for use in AppDelegate or other native code.
|
|
10
|
+
*
|
|
11
|
+
* Usage in AppDelegate.m:
|
|
12
|
+
* ```
|
|
13
|
+
* #import <Callingx/CallingxPublic.h>
|
|
14
|
+
*
|
|
15
|
+
* [Callingx reportNewIncomingCall:callId
|
|
16
|
+
* handle:handle
|
|
17
|
+
* handleType:@"number"
|
|
18
|
+
* hasVideo:YES
|
|
19
|
+
* localizedCallerName:callerName
|
|
20
|
+
* supportsHolding:NO
|
|
21
|
+
* supportsDTMF:NO
|
|
22
|
+
* supportsGrouping:NO
|
|
23
|
+
* supportsUngrouping:NO
|
|
24
|
+
* fromPushKit:YES
|
|
25
|
+
* payload:payload
|
|
26
|
+
* withCompletionHandler:^{ }];
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
@interface Callingx : NSObject
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Report a new incoming call to CallKit.
|
|
33
|
+
* Call this from your PushKit delegate when receiving a VoIP push notification.
|
|
34
|
+
*
|
|
35
|
+
* @param callId Unique identifier for the call (e.g., call ID from your backend)
|
|
36
|
+
* @param handle The phone number or identifier to display
|
|
37
|
+
* @param handleType Type of handle: "number", "email", or "generic"
|
|
38
|
+
* @param hasVideo Whether this is a video call
|
|
39
|
+
* @param localizedCallerName The caller's display name
|
|
40
|
+
* @param supportsHolding Whether the call supports being put on hold
|
|
41
|
+
* @param supportsDTMF Whether the call supports DTMF tones
|
|
42
|
+
* @param supportsGrouping Whether the call can be grouped with other calls
|
|
43
|
+
* @param supportsUngrouping Whether the call can be ungrouped
|
|
44
|
+
* @param fromPushKit Whether this call is from a PushKit notification
|
|
45
|
+
* @param payload Optional payload data from the push notification
|
|
46
|
+
* @param completion Completion handler called after the call is reported
|
|
47
|
+
*/
|
|
48
|
+
+ (void)reportNewIncomingCall:(NSString *)callId
|
|
49
|
+
handle:(NSString *)handle
|
|
50
|
+
handleType:(NSString *)handleType
|
|
51
|
+
hasVideo:(BOOL)hasVideo
|
|
52
|
+
localizedCallerName:(NSString * _Nullable)localizedCallerName
|
|
53
|
+
supportsHolding:(BOOL)supportsHolding
|
|
54
|
+
supportsDTMF:(BOOL)supportsDTMF
|
|
55
|
+
supportsGrouping:(BOOL)supportsGrouping
|
|
56
|
+
supportsUngrouping:(BOOL)supportsUngrouping
|
|
57
|
+
fromPushKit:(BOOL)fromPushKit
|
|
58
|
+
payload:(NSDictionary * _Nullable)payload
|
|
59
|
+
withCompletionHandler:(void (^_Nullable)(void))completion;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* End a call with a specific reason.
|
|
63
|
+
*
|
|
64
|
+
* @param callId The call ID to end
|
|
65
|
+
* @param reason The reason for ending: 1=failed, 2=remoteEnded, 3=unanswered, 4=answeredElsewhere, 5=declinedElsewhere
|
|
66
|
+
*/
|
|
67
|
+
+ (void)endCall:(NSString *)callId
|
|
68
|
+
reason:(int)reason;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Check if a new call can be registered (based on shouldRejectCallWhenBusy setting)
|
|
72
|
+
*
|
|
73
|
+
* @return YES if a new call can be registered, NO if should be rejected
|
|
74
|
+
*/
|
|
75
|
+
+ (BOOL)canRegisterCall;
|
|
76
|
+
|
|
77
|
+
@end
|
|
78
|
+
|
|
79
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import CallKit
|
|
3
|
+
import UIKit
|
|
4
|
+
|
|
5
|
+
@objcMembers public class Settings: NSObject {
|
|
6
|
+
private static let settingsKey = "CallingxSettings"
|
|
7
|
+
|
|
8
|
+
public static func getSettings() -> [String: Any] {
|
|
9
|
+
return UserDefaults.standard.dictionary(forKey: settingsKey) ?? [:]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public static func setSettings(_ options: [String: Any]?) {
|
|
13
|
+
#if DEBUG
|
|
14
|
+
print("[Settings][setSettings] options = \(String(describing: options))")
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
var settings: [String: Any] = getSettings()
|
|
18
|
+
|
|
19
|
+
if let options = options {
|
|
20
|
+
for (key, value) in options {
|
|
21
|
+
settings[key] = value
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
UserDefaults.standard.set(settings, forKey: settingsKey)
|
|
26
|
+
UserDefaults.standard.synchronize()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public static func getShouldRejectCallWhenBusy() -> Bool {
|
|
30
|
+
guard let shouldReject = getSettings()["shouldRejectCallWhenBusy"] as? Bool else {
|
|
31
|
+
return false
|
|
32
|
+
}
|
|
33
|
+
return shouldReject
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public static func setShouldRejectCallWhenBusy(_ shouldReject: Bool) {
|
|
37
|
+
setSettings(["shouldRejectCallWhenBusy": shouldReject])
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public static func getProviderConfiguration() -> CXProviderConfiguration {
|
|
41
|
+
#if DEBUG
|
|
42
|
+
print("[Settings][getProviderConfiguration]")
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
let settings = getSettings()
|
|
46
|
+
let providerConfiguration = CXProviderConfiguration()
|
|
47
|
+
providerConfiguration.supportsVideo = true
|
|
48
|
+
providerConfiguration.maximumCallGroups = 1
|
|
49
|
+
providerConfiguration.maximumCallsPerCallGroup = 1
|
|
50
|
+
providerConfiguration.supportedHandleTypes = getSupportedHandleTypes(settings["handleType"])
|
|
51
|
+
|
|
52
|
+
if let supportsVideo = settings["supportsVideo"] as? Bool {
|
|
53
|
+
providerConfiguration.supportsVideo = supportsVideo
|
|
54
|
+
}
|
|
55
|
+
if let maximumCallGroups = settings["maximumCallGroups"] as? Int {
|
|
56
|
+
providerConfiguration.maximumCallGroups = maximumCallGroups
|
|
57
|
+
}
|
|
58
|
+
if let maximumCallsPerCallGroup = settings["maximumCallsPerCallGroup"] as? Int {
|
|
59
|
+
providerConfiguration.maximumCallsPerCallGroup = maximumCallsPerCallGroup
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if let imageName = settings["imageName"] as? String, !imageName.isEmpty {
|
|
63
|
+
if let image = UIImage(named: imageName) {
|
|
64
|
+
providerConfiguration.iconTemplateImageData = image.pngData()
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if let ringtoneSound = settings["ringtoneSound"] as? String, !ringtoneSound.isEmpty {
|
|
69
|
+
providerConfiguration.ringtoneSound = ringtoneSound
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if let includesCallsInRecents = settings["includesCallsInRecents"] as? Bool {
|
|
73
|
+
providerConfiguration.includesCallsInRecents = includesCallsInRecents
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return providerConfiguration
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public static func getSupportedHandleTypes(_ handleType: Any?) -> Set<CXHandle.HandleType> {
|
|
80
|
+
if let handleTypeArray = handleType as? [String] {
|
|
81
|
+
var types = Set<CXHandle.HandleType>()
|
|
82
|
+
for type in handleTypeArray {
|
|
83
|
+
types.insert(getHandleType(type))
|
|
84
|
+
}
|
|
85
|
+
return types
|
|
86
|
+
} else if let handleTypeString = handleType as? String {
|
|
87
|
+
let type = getHandleType(handleTypeString)
|
|
88
|
+
return Set([type])
|
|
89
|
+
} else {
|
|
90
|
+
return Set([CXHandle.HandleType.phoneNumber])
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public static func getHandleType(_ handleType: String?) -> CXHandle.HandleType {
|
|
95
|
+
guard let handleType = handleType else { return .generic }
|
|
96
|
+
|
|
97
|
+
switch handleType {
|
|
98
|
+
case "generic":
|
|
99
|
+
return .generic
|
|
100
|
+
case "number", "phone":
|
|
101
|
+
return .phoneNumber
|
|
102
|
+
case "email":
|
|
103
|
+
return .emailAddress
|
|
104
|
+
default:
|
|
105
|
+
return .generic
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
@objcMembers public class UUIDStorage: NSObject {
|
|
4
|
+
private var uuidDict: [String: String] = [:]
|
|
5
|
+
private var cidDict: [String: String] = [:]
|
|
6
|
+
private let queue = DispatchQueue(label: "com.stream.uuidstorage", attributes: [])
|
|
7
|
+
|
|
8
|
+
public override init() {
|
|
9
|
+
super.init()
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public func allUUIDs() -> [UUID] {
|
|
13
|
+
return queue.sync {
|
|
14
|
+
return uuidDict.values.compactMap { UUID(uuidString: $0.lowercased()) }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public func getOrCreateUUID(forCid cid: String) -> UUID {
|
|
19
|
+
return queue.sync {
|
|
20
|
+
// Check if cid exists (inlined to avoid nested sync call)
|
|
21
|
+
if let existingUUID = uuidDict[cid] {
|
|
22
|
+
#if DEBUG
|
|
23
|
+
print("[UUIDStorage] getUUIDForCid: found existing UUID \(existingUUID) for cid \(cid)")
|
|
24
|
+
#endif
|
|
25
|
+
return UUID(uuidString: existingUUID) ?? UUID()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let uuid = UUID()
|
|
29
|
+
let uuidString = uuid.uuidString.lowercased()
|
|
30
|
+
uuidDict[cid] = uuidString
|
|
31
|
+
cidDict[uuidString] = cid
|
|
32
|
+
#if DEBUG
|
|
33
|
+
print("[UUIDStorage] getUUIDForCid: created new UUID \(uuidString) for cid \(cid)")
|
|
34
|
+
#endif
|
|
35
|
+
return uuid
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public func getUUID(forCid cid: String) -> UUID? {
|
|
40
|
+
return queue.sync {
|
|
41
|
+
guard let uuidString = uuidDict[cid] else { return nil }
|
|
42
|
+
return UUID(uuidString: uuidString)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public func getCid(forUUID uuid: UUID) -> String? {
|
|
47
|
+
return queue.sync {
|
|
48
|
+
let uuidString = uuid.uuidString.lowercased()
|
|
49
|
+
let cid = cidDict[uuidString]
|
|
50
|
+
#if DEBUG
|
|
51
|
+
print("[UUIDStorage] getCidForUUID: UUID \(uuidString) -> cid \(cid ?? "(not found)")")
|
|
52
|
+
#endif
|
|
53
|
+
return cid
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public func removeCid(forUUID uuid: UUID) {
|
|
58
|
+
queue.sync {
|
|
59
|
+
let uuidString = uuid.uuidString.lowercased()
|
|
60
|
+
if let cid = cidDict[uuidString] {
|
|
61
|
+
uuidDict.removeValue(forKey: cid)
|
|
62
|
+
cidDict.removeValue(forKey: uuidString)
|
|
63
|
+
#if DEBUG
|
|
64
|
+
print("[UUIDStorage] removeCidForUUID: removed cid \(cid) for UUID \(uuidString)")
|
|
65
|
+
#endif
|
|
66
|
+
} else {
|
|
67
|
+
#if DEBUG
|
|
68
|
+
print("[UUIDStorage] removeCidForUUID: no cid found for UUID \(uuidString)")
|
|
69
|
+
#endif
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public func removeCid(_ cid: String) {
|
|
75
|
+
queue.sync {
|
|
76
|
+
if let uuidString = uuidDict[cid] {
|
|
77
|
+
cidDict.removeValue(forKey: uuidString)
|
|
78
|
+
uuidDict.removeValue(forKey: cid)
|
|
79
|
+
#if DEBUG
|
|
80
|
+
print("[UUIDStorage] removeCid: removed cid \(cid) with UUID \(uuidString)")
|
|
81
|
+
#endif
|
|
82
|
+
} else {
|
|
83
|
+
#if DEBUG
|
|
84
|
+
print("[UUIDStorage] removeCid: no UUID found for cid \(cid)")
|
|
85
|
+
#endif
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public func removeAllObjects() {
|
|
91
|
+
queue.sync {
|
|
92
|
+
let count = uuidDict.count
|
|
93
|
+
uuidDict.removeAll()
|
|
94
|
+
cidDict.removeAll()
|
|
95
|
+
#if DEBUG
|
|
96
|
+
print("[UUIDStorage] removeAllObjects: cleared \(count) entries")
|
|
97
|
+
#endif
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public func count() -> Int {
|
|
102
|
+
return queue.sync {
|
|
103
|
+
return uuidDict.count
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public func containsCid(_ cid: String) -> Bool {
|
|
108
|
+
return queue.sync {
|
|
109
|
+
return uuidDict[cid] != nil
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
public func containsUUID(_ uuid: UUID) -> Bool {
|
|
114
|
+
return queue.sync {
|
|
115
|
+
return cidDict[uuid.uuidString.lowercased()] != nil
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public override var description: String {
|
|
120
|
+
return queue.sync {
|
|
121
|
+
return "UUIDStorage: \(uuidDict)"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import PushKit
|
|
3
|
+
import React
|
|
4
|
+
|
|
5
|
+
@objcMembers public class VoipNotificationsEvents: NSObject {
|
|
6
|
+
public static let registered = "voipNotificationsRegistered"
|
|
7
|
+
public static let newNotification = "voipNotificationReceived"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
typealias RNVoipPushNotificationCompletion = () -> Void
|
|
11
|
+
|
|
12
|
+
@objc public protocol VoipNotificationsEventEmitter {
|
|
13
|
+
func emitVoipEvent(_ dictionary: [String: Any])
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@objc public class VoipNotificationsManager: NSObject {
|
|
17
|
+
|
|
18
|
+
@objc public weak var eventEmitter: VoipNotificationsEventEmitter?
|
|
19
|
+
|
|
20
|
+
private static var isVoipRegistered = false
|
|
21
|
+
private static var lastVoipToken = ""
|
|
22
|
+
private static var voipRegistry: PKPushRegistry?
|
|
23
|
+
|
|
24
|
+
private var canSendEvents: Bool = false
|
|
25
|
+
private var delayedEvents: [[String:Any]] = []
|
|
26
|
+
|
|
27
|
+
private static var sharedInstance: VoipNotificationsManager?
|
|
28
|
+
|
|
29
|
+
@objc public static func shared() -> VoipNotificationsManager {
|
|
30
|
+
if sharedInstance == nil {
|
|
31
|
+
sharedInstance = VoipNotificationsManager()
|
|
32
|
+
}
|
|
33
|
+
return sharedInstance!
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@objc public override init() {
|
|
37
|
+
super.init()
|
|
38
|
+
|
|
39
|
+
canSendEvents = false
|
|
40
|
+
delayedEvents = []
|
|
41
|
+
|
|
42
|
+
if VoipNotificationsManager.sharedInstance == nil {
|
|
43
|
+
VoipNotificationsManager.sharedInstance = self
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
deinit {
|
|
48
|
+
NotificationCenter.default.removeObserver(self)
|
|
49
|
+
|
|
50
|
+
canSendEvents = false
|
|
51
|
+
delayedEvents = []
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// MARK: - Class Methods
|
|
55
|
+
|
|
56
|
+
@objc public static func voipRegistration() {
|
|
57
|
+
if isVoipRegistered {
|
|
58
|
+
#if DEBUG
|
|
59
|
+
print("[VoipNotificationsManager] voipRegistration is already registered. return _lastVoipToken = \(lastVoipToken)")
|
|
60
|
+
#endif
|
|
61
|
+
let voipPushManager = VoipNotificationsManager.shared()
|
|
62
|
+
voipPushManager.sendEventWithNameWrapper(name: VoipNotificationsEvents.registered, body: ["token": lastVoipToken])
|
|
63
|
+
} else {
|
|
64
|
+
#if DEBUG
|
|
65
|
+
print("[VoipNotificationsManager] voipRegistration enter")
|
|
66
|
+
#endif
|
|
67
|
+
DispatchQueue.main.async {
|
|
68
|
+
let voipRegistry = PKPushRegistry(queue: DispatchQueue.main)
|
|
69
|
+
// Set the registry's delegate to AppDelegate
|
|
70
|
+
// Note: The original code casts the delegate, but this should be handled by AppDelegate
|
|
71
|
+
if let appDelegate = RCTSharedApplication()?.delegate as? PKPushRegistryDelegate {
|
|
72
|
+
voipRegistry.delegate = appDelegate
|
|
73
|
+
// Set the push type to VoIP
|
|
74
|
+
// Store the registry to prevent deallocation
|
|
75
|
+
voipRegistry.desiredPushTypes = [.voIP]
|
|
76
|
+
VoipNotificationsManager.voipRegistry = voipRegistry
|
|
77
|
+
|
|
78
|
+
isVoipRegistered = true
|
|
79
|
+
} else {
|
|
80
|
+
#if DEBUG
|
|
81
|
+
print("[VoipNotificationsManager] voipRegistration appDelegate not found. return")
|
|
82
|
+
#endif
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@objc public static func didUpdatePushCredentials(_ credentials: PKPushCredentials, forType type: String) {
|
|
89
|
+
#if DEBUG
|
|
90
|
+
print("[VoipNotificationsManager] didUpdatePushCredentials credentials.token = \(credentials.token), type = \(type)")
|
|
91
|
+
#endif
|
|
92
|
+
|
|
93
|
+
let voipTokenLength = credentials.token.count
|
|
94
|
+
if voipTokenLength == 0 {
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
lastVoipToken = credentials.token.map { String(format: "%02x", $0) }.joined()
|
|
99
|
+
|
|
100
|
+
let voipPushManager = VoipNotificationsManager.shared()
|
|
101
|
+
voipPushManager.sendEventWithNameWrapper(name: VoipNotificationsEvents.registered, body: ["token": lastVoipToken])
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@objc public static func didReceiveIncomingPushWithPayload(_ payload: PKPushPayload, forType type: String) {
|
|
105
|
+
#if DEBUG
|
|
106
|
+
print("[VoipNotificationsManager] didReceiveIncomingPushWithPayload payload.dictionaryPayload = \(payload.dictionaryPayload), type = \(type)")
|
|
107
|
+
#endif
|
|
108
|
+
|
|
109
|
+
let dictionaryPayload: [String: Any] = Dictionary(uniqueKeysWithValues: payload.dictionaryPayload.map { (key, value) in
|
|
110
|
+
(String(describing: key), value)
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
let voipPushManager = VoipNotificationsManager.shared()
|
|
114
|
+
voipPushManager.sendEventWithNameWrapper(name: VoipNotificationsEvents.newNotification, body: dictionaryPayload)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// MARK: - React Native Methods
|
|
118
|
+
@objc public func getInitialEvents() -> [[String: Any]] {
|
|
119
|
+
var events: [[String: Any]] = []
|
|
120
|
+
let action = {
|
|
121
|
+
#if DEBUG
|
|
122
|
+
print("[VoipNotificationsManager][getInitialEvents] delayedEvents = \(self.delayedEvents)")
|
|
123
|
+
#endif
|
|
124
|
+
|
|
125
|
+
events = self.delayedEvents
|
|
126
|
+
self.delayedEvents = []
|
|
127
|
+
self.canSendEvents = true
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (Thread.isMainThread) {
|
|
131
|
+
action()
|
|
132
|
+
} else {
|
|
133
|
+
DispatchQueue.main.sync {
|
|
134
|
+
action()
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return events
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@objc public func registerVoipToken() {
|
|
141
|
+
if RCTRunningInAppExtension() {
|
|
142
|
+
return
|
|
143
|
+
}
|
|
144
|
+
DispatchQueue.main.async {
|
|
145
|
+
VoipNotificationsManager.voipRegistration()
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
private func sendEventWithNameWrapper(name: String, body: [String: Any]?) {
|
|
150
|
+
#if DEBUG
|
|
151
|
+
print("[VoipNotificationsManager] sendEventWithNameWrapper: \(name)")
|
|
152
|
+
#endif
|
|
153
|
+
|
|
154
|
+
let sendEventAction = {
|
|
155
|
+
var dictionary: [String: Any] = ["eventName": name]
|
|
156
|
+
if let body = body {
|
|
157
|
+
dictionary["params"] = body
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if self.canSendEvents {
|
|
161
|
+
self.eventEmitter?.emitVoipEvent(dictionary)
|
|
162
|
+
} else {
|
|
163
|
+
self.delayedEvents.append(dictionary)
|
|
164
|
+
#if DEBUG
|
|
165
|
+
print("[VoipNotificationsManager] delayedEvents: \(self.delayedEvents)")
|
|
166
|
+
#endif
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (Thread.isMainThread) {
|
|
171
|
+
sendEventAction()
|
|
172
|
+
} else {
|
|
173
|
+
DispatchQueue.main.async {
|
|
174
|
+
sendEventAction()
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stream-io/react-native-callingx",
|
|
3
|
+
"version": "0.1.0-beta.0",
|
|
4
|
+
"description": "CallKit and Telecom API capabilities for React Native",
|
|
5
|
+
"main": "./dist/module/index.js",
|
|
6
|
+
"module": "./dist/module/index.js",
|
|
7
|
+
"types": "./dist/typescript/src/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"source": "./src/index.ts",
|
|
13
|
+
"types": "./dist/typescript/src/index.d.ts",
|
|
14
|
+
"default": "./dist/module/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"src",
|
|
20
|
+
"dist",
|
|
21
|
+
"android",
|
|
22
|
+
"ios",
|
|
23
|
+
"cpp",
|
|
24
|
+
"*.podspec",
|
|
25
|
+
"react-native.config.js",
|
|
26
|
+
"!ios/build",
|
|
27
|
+
"!android/build",
|
|
28
|
+
"!android/gradle",
|
|
29
|
+
"!android/gradlew",
|
|
30
|
+
"!android/gradlew.bat",
|
|
31
|
+
"!android/local.properties",
|
|
32
|
+
"!**/__tests__",
|
|
33
|
+
"!**/__fixtures__",
|
|
34
|
+
"!**/__mocks__",
|
|
35
|
+
"!**/.*"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"clean": "del-cli android/build dist",
|
|
39
|
+
"prepare": "bob build",
|
|
40
|
+
"build": "bob build",
|
|
41
|
+
"typecheck": "tsc"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"react-native",
|
|
45
|
+
"ios",
|
|
46
|
+
"android"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/GetStream/stream-video-js.git"
|
|
51
|
+
},
|
|
52
|
+
"author": "https://getstream.io <support@getstream.io> (https://github.com/GetStream)",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/GetStream/stream-video-js/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/GetStream/stream-video-js#readme",
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"registry": "https://registry.npmjs.org/"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@react-native-community/cli": "20.0.1",
|
|
63
|
+
"@react-native/babel-preset": "^0.81.5",
|
|
64
|
+
"@stream-io/react-native-webrtc": "137.1.0",
|
|
65
|
+
"@types/react": "^19.1.0",
|
|
66
|
+
"del-cli": "^6.0.0",
|
|
67
|
+
"react": "19.1.0",
|
|
68
|
+
"react-native": "^0.81.5",
|
|
69
|
+
"react-native-builder-bob": "^0.40.15",
|
|
70
|
+
"typescript": "^5.9.2"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@stream-io/react-native-webrtc": ">=137.1.0",
|
|
74
|
+
"react": "*",
|
|
75
|
+
"react-native": "*"
|
|
76
|
+
},
|
|
77
|
+
"react-native-builder-bob": {
|
|
78
|
+
"source": "src",
|
|
79
|
+
"output": "dist",
|
|
80
|
+
"targets": [
|
|
81
|
+
[
|
|
82
|
+
"module",
|
|
83
|
+
{
|
|
84
|
+
"esm": true
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
[
|
|
88
|
+
"typescript",
|
|
89
|
+
{
|
|
90
|
+
"project": "tsconfig.build.json"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"codegenConfig": {
|
|
96
|
+
"name": "CallingxSpec",
|
|
97
|
+
"type": "modules",
|
|
98
|
+
"jsSrcsDir": "src/spec",
|
|
99
|
+
"android": {
|
|
100
|
+
"javaPackageName": "io.getstream.rn.callingx"
|
|
101
|
+
},
|
|
102
|
+
"ios": {
|
|
103
|
+
"moduleName": "Callingx"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"create-react-native-library": {
|
|
107
|
+
"languages": "kotlin-objc",
|
|
108
|
+
"type": "turbo-module",
|
|
109
|
+
"tools": [],
|
|
110
|
+
"version": "0.55.0"
|
|
111
|
+
}
|
|
112
|
+
}
|