@telnyx/react-voice-commons-sdk 0.1.4 → 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.
Files changed (237) hide show
  1. package/CHANGELOG.md +31 -16
  2. package/README.md +469 -469
  3. package/TelnyxVoiceCommons.podspec +31 -31
  4. package/android/build/.transforms/35d64beab84343a7420320f8057c40b9/results.bin +1 -0
  5. package/android/build/.transforms/35d64beab84343a7420320f8057c40b9/transformed/classes/classes_dex/classes.dex +0 -0
  6. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/results.bin +1 -0
  7. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/BuildConfig.dex +0 -0
  8. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/CallForegroundService$Companion.dex +0 -0
  9. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/CallForegroundService.dex +0 -0
  10. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.dex +0 -0
  11. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxMainActivity$Companion.dex +0 -0
  12. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxMainActivity.dex +0 -0
  13. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.dex +0 -0
  14. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationHelper$Companion.dex +0 -0
  15. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationHelper.dex +0 -0
  16. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgeModule$Companion.dex +0 -0
  17. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgeModule.dex +0 -0
  18. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgePackage.dex +0 -0
  19. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnManager.dex +0 -0
  20. package/android/build/.transforms/81896f393ea3c2e44a76283db01ad461/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  21. package/android/build/.transforms/8ebc6907344eccd2b9c23d903854d4fb/results.bin +1 -0
  22. package/android/build/.transforms/8ebc6907344eccd2b9c23d903854d4fb/transformed/classes/classes_dex/classes.dex +0 -0
  23. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/results.bin +1 -0
  24. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/BuildConfig.dex +0 -0
  25. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.dex +0 -0
  26. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxMainActivity$Companion.dex +0 -0
  27. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxMainActivity.dex +0 -0
  28. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.dex +0 -0
  29. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationHelper$Companion.dex +0 -0
  30. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/TelnyxNotificationHelper.dex +0 -0
  31. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgeModule.dex +0 -0
  32. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnBridgePackage.dex +0 -0
  33. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/telnyx/react_voice_commons/VoicePnManager.dex +0 -0
  34. package/android/build/.transforms/af1ab9e262e91ec4942977987fb9a0ae/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  35. package/android/build/generated/source/buildConfig/debug/com/telnyx/react_voice_commons/BuildConfig.java +10 -0
  36. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +42 -0
  37. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  38. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  39. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  40. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  41. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  42. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  43. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  44. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  45. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  46. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  47. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  48. package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/telnyx_react-voice-commons-sdk_debug.kotlin_module +0 -0
  49. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/telnyx/react_voice_commons/BuildConfig.class +0 -0
  50. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
  51. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +75 -0
  52. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +42 -0
  53. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  54. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  55. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/telnyx_react-voice-commons-sdk_debug.kotlin_module +0 -0
  56. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/BuildConfig.class +0 -0
  57. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/CallForegroundService$Companion.class +0 -0
  58. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/CallForegroundService.class +0 -0
  59. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.class +0 -0
  60. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxMainActivity$Companion.class +0 -0
  61. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxMainActivity.class +0 -0
  62. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.class +0 -0
  63. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxNotificationHelper$Companion.class +0 -0
  64. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/TelnyxNotificationHelper.class +0 -0
  65. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/VoicePnBridgeModule$Companion.class +0 -0
  66. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/VoicePnBridgeModule.class +0 -0
  67. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/VoicePnBridgePackage.class +0 -0
  68. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/telnyx/react_voice_commons/VoicePnManager.class +0 -0
  69. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  70. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
  71. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  72. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  73. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  74. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  75. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  76. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  77. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  78. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  81. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  82. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  83. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  85. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  91. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  92. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  93. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  94. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  95. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  96. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  97. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  98. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  99. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  100. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  101. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  104. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  105. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  106. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  107. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  108. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  109. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  110. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  111. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  112. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  113. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  114. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  115. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  116. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  119. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  120. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  121. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  122. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  123. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  124. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  125. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  126. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  127. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  128. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  129. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  130. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  131. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  132. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  133. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  134. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +2 -0
  135. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  136. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  137. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  138. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  139. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  140. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  141. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  142. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  143. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  144. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  145. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  146. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  147. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  148. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  149. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  150. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  151. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  152. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  153. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  154. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  155. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  156. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  157. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  158. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  159. package/android/build/outputs/logs/manifest-merger-debug-report.txt +82 -0
  160. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  161. package/android/build/tmp/kotlin-classes/debug/META-INF/telnyx_react-voice-commons-sdk_debug.kotlin_module +0 -0
  162. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/CallForegroundService$Companion.class +0 -0
  163. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/CallForegroundService.class +0 -0
  164. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.class +0 -0
  165. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxMainActivity$Companion.class +0 -0
  166. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxMainActivity.class +0 -0
  167. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.class +0 -0
  168. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxNotificationHelper$Companion.class +0 -0
  169. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/TelnyxNotificationHelper.class +0 -0
  170. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/VoicePnBridgeModule$Companion.class +0 -0
  171. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/VoicePnBridgeModule.class +0 -0
  172. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/VoicePnBridgePackage.class +0 -0
  173. package/android/build/tmp/kotlin-classes/debug/com/telnyx/react_voice_commons/VoicePnManager.class +0 -0
  174. package/android/build.gradle +45 -0
  175. package/android/local.properties +8 -0
  176. package/android/src/main/AndroidManifest.xml +38 -0
  177. package/android/src/main/java/com/telnyx/react_voice_commons/CallForegroundService.kt +83 -0
  178. package/android/src/main/java/com/telnyx/react_voice_commons/TelnyxFirebaseMessagingService.kt +179 -0
  179. package/android/src/main/java/com/telnyx/react_voice_commons/TelnyxMainActivity.kt +216 -0
  180. package/android/src/main/java/com/telnyx/react_voice_commons/TelnyxNotificationActionReceiver.kt +177 -0
  181. package/android/src/main/java/com/telnyx/react_voice_commons/TelnyxNotificationHelper.kt +277 -0
  182. package/android/src/main/java/com/telnyx/react_voice_commons/VoicePnBridgeModule.kt +247 -0
  183. package/android/src/main/java/com/telnyx/react_voice_commons/VoicePnBridgePackage.kt +17 -0
  184. package/android/src/main/java/com/telnyx/react_voice_commons/VoicePnManager.kt +154 -0
  185. package/ios/CallKitBridge.m +43 -43
  186. package/ios/CallKitBridge.swift +874 -874
  187. package/ios/VoicePnBridge.m +30 -30
  188. package/ios/VoicePnBridge.swift +86 -86
  189. package/lib/callkit/callkit-coordinator.d.ts +114 -110
  190. package/lib/callkit/callkit-coordinator.js +706 -664
  191. package/lib/callkit/callkit.d.ts +41 -41
  192. package/lib/callkit/callkit.js +242 -252
  193. package/lib/callkit/index.js +47 -15
  194. package/lib/callkit/use-callkit.d.ts +19 -19
  195. package/lib/callkit/use-callkit.js +310 -270
  196. package/lib/context/TelnyxVoiceContext.d.ts +9 -9
  197. package/lib/context/TelnyxVoiceContext.js +13 -10
  198. package/lib/hooks/use-callkit-coordinator.d.ts +17 -9
  199. package/lib/hooks/use-callkit-coordinator.js +50 -45
  200. package/lib/hooks/useAppReadyNotifier.js +15 -13
  201. package/lib/hooks/useAppStateHandler.d.ts +11 -6
  202. package/lib/hooks/useAppStateHandler.js +110 -95
  203. package/lib/index.d.ts +21 -3
  204. package/lib/index.js +201 -50
  205. package/lib/internal/CallKitHandler.d.ts +6 -6
  206. package/lib/internal/CallKitHandler.js +104 -96
  207. package/lib/internal/callkit-manager.d.ts +57 -57
  208. package/lib/internal/callkit-manager.js +316 -299
  209. package/lib/internal/calls/call-state-controller.d.ts +78 -73
  210. package/lib/internal/calls/call-state-controller.js +326 -265
  211. package/lib/internal/session/session-manager.d.ts +71 -71
  212. package/lib/internal/session/session-manager.js +437 -360
  213. package/lib/internal/user-defaults-helpers.js +39 -49
  214. package/lib/internal/voice-pn-bridge.d.ts +112 -104
  215. package/lib/internal/voice-pn-bridge.js +193 -203
  216. package/lib/models/call-state.d.ts +46 -46
  217. package/lib/models/call-state.js +74 -70
  218. package/lib/models/call.d.ts +173 -157
  219. package/lib/models/call.js +492 -448
  220. package/lib/models/config.d.ts +18 -11
  221. package/lib/models/config.js +35 -37
  222. package/lib/models/connection-state.d.ts +10 -10
  223. package/lib/models/connection-state.js +16 -16
  224. package/lib/telnyx-voice-app.d.ts +28 -28
  225. package/lib/telnyx-voice-app.js +561 -509
  226. package/lib/telnyx-voip-client.d.ts +174 -167
  227. package/lib/telnyx-voip-client.js +397 -385
  228. package/package.json +116 -115
  229. package/src/callkit/callkit-coordinator.ts +830 -830
  230. package/src/internal/calls/call-state-controller.ts +407 -407
  231. package/src/internal/session/session-manager.ts +483 -483
  232. package/src/internal/voice-pn-bridge.ts +266 -266
  233. package/src/models/call-state.ts +105 -105
  234. package/src/models/call.ts +502 -502
  235. package/src/telnyx-voice-app.tsx +787 -788
  236. package/src/telnyx-voip-client.ts +551 -551
  237. package/src/types/telnyx-sdk.d.ts +93 -93
package/README.md CHANGED
@@ -1,469 +1,469 @@
1
- # Telnyx React Voice Commons SDK
2
-
3
- A high-level, state-agnostic, drop-in module for the Telnyx React Native SDK that simplifies WebRTC voice calling integration. This library provides a comprehensive solution for building VoIP applications with native call UI support, push notifications, and seamless background handling.
4
-
5
- ### Key Features
6
-
7
- - **TelnyxVoiceApp Integration**: Automatic lifecycle management and push notification handling
8
- - **Native Call UI**: CallKit (iOS) and ConnectionService (Android) integration
9
- - **Background Handling**: Seamless app state transitions and background call processing
10
- - **Push Notifications**: Firebase (Android) and APNs (iOS) integration
11
- - **Reactive State Management**: RxJS-based state streams for real-time UI updates
12
- - **TypeScript Support**: Full TypeScript definitions for better developer experience
13
- - **Cross-Platform**: Built for both iOS and Android with React Native
14
-
15
- ## About @telnyx/react-voice-commons-sdk
16
-
17
- The `@telnyx/react-voice-commons-sdk` library provides:
18
-
19
- - **Headless Operation**: Core library that can establish and manage call state programmatically
20
- - **Reactive Streams**: All state exposed via RxJS observables for easy integration
21
- - **Simplified API**: Single facade class (`TelnyxVoipClient`) that hides underlying complexity
22
- - **Automatic Lifecycle Management**: Background/foreground handling with `TelnyxVoiceApp` component
23
- - **Call State Management**: Central state machine for managing multiple calls
24
- - **Session Management**: Automatic connection lifecycle with reconnection logic
25
- - **Push Notification Support**: Built-in handling for background push notifications
26
- - **TypeScript Support**: Full TypeScript definitions for better developer experience
27
-
28
- ## Integration Guide
29
-
30
- ### Basic Setup
31
-
32
- Integrate the library using the `TelnyxVoiceApp` component for automatic lifecycle management:
33
-
34
- ```tsx
35
- import { TelnyxVoiceApp, createTelnyxVoipClient } from '@telnyx/react-voice-commons-sdk';
36
-
37
- // Create the VoIP client instance
38
- const voipClient = createTelnyxVoipClient({
39
- enableAppStateManagement: true, // Optional: Enable automatic app state management (default: true)
40
- debug: true, // Optional: Enable debug logging
41
- });
42
-
43
- export default function App() {
44
- return (
45
- <TelnyxVoiceApp voipClient={voipClient} enableAutoReconnect={false} debug={true}>
46
- <YourAppContent />
47
- </TelnyxVoiceApp>
48
- );
49
- }
50
- ```
51
-
52
- ### Core Components
53
-
54
- #### 1. VoIP Client Configuration
55
-
56
- ```tsx
57
- const voipClient = createTelnyxVoipClient({
58
- enableAppStateManagement: true, // Optional: Enable automatic app state management (default: true)
59
- debug: true, // Optional: Enable debug logging
60
- });
61
- ```
62
-
63
- **Configuration Options Explained:**
64
-
65
- - **`enableAppStateManagement: true`** - **Optional (default: true)**: Enables automatic background/foreground app state management. When enabled, the library automatically disconnects when the app goes to background (unless there's an active call) and handles reconnection logic. Set to `false` if you want to handle app lifecycle manually.
66
- - **`debug: true`** - **Optional**: Enables detailed logging for connection states, call transitions, and push notification processing. Useful for development and troubleshooting.
67
-
68
- #### 2. TelnyxVoiceApp Wrapper
69
-
70
- The `TelnyxVoiceApp` component handles:
71
-
72
- - Automatic background/foreground lifecycle management
73
- - Push notification processing from terminated state
74
- - Login state management with automatic reconnection
75
- - Background client management for push notifications
76
-
77
- #### 3. Reactive State Management
78
-
79
- ```tsx
80
- // Listen to connection state
81
- voipClient.connectionState$.subscribe((state) => {
82
- console.log('Connection state:', state);
83
- });
84
-
85
- // Listen to active calls
86
- voipClient.calls$.subscribe((calls) => {
87
- console.log('Active calls:', calls);
88
- });
89
-
90
- // Handle individual call state
91
- call.callState$.subscribe((state) => {
92
- console.log('Call state:', state);
93
- });
94
- ```
95
-
96
- #### 4. Call Management
97
-
98
- ```tsx
99
- // Make a call
100
- const call = await voipClient.newCall('1234567890');
101
-
102
- // Answer incoming call
103
- await call.answer();
104
-
105
- // Control call
106
- await call.mute();
107
- await call.hold();
108
- await call.hangup();
109
- ```
110
-
111
- ### Authentication & Persistent Storage
112
-
113
- The library supports both credential-based and token-based authentication with automatic persistence for seamless reconnection.
114
-
115
- #### Authentication Methods
116
-
117
- ##### 1. Credential-Based Authentication
118
-
119
- ```tsx
120
- import { createCredentialConfig } from '@telnyx/react-voice-commons-sdk';
121
-
122
- const config = createCredentialConfig('your_sip_username', 'your_sip_password', {
123
- debug: true,
124
- pushNotificationDeviceToken: 'your_device_token',
125
- });
126
-
127
- await voipClient.login(config);
128
- ```
129
-
130
- ##### 2. Token-Based Authentication
131
-
132
- ```tsx
133
- import { createTokenConfig } from '@telnyx/react-voice-commons-sdk';
134
-
135
- const config = createTokenConfig('your_jwt_token', {
136
- debug: true,
137
- pushNotificationDeviceToken: 'your_device_token',
138
- });
139
-
140
- await voipClient.loginWithToken(config);
141
- ```
142
-
143
- #### Automatic Storage & Reconnection
144
-
145
- The library automatically stores authentication data securely for seamless reconnection. **You don't need to manually manage these storage keys** - the library handles everything internally.
146
-
147
- ##### Internal Storage (Managed Automatically)
148
-
149
- The library uses these AsyncStorage keys internally:
150
-
151
- - `@telnyx_username` - SIP username (credential auth)
152
- - `@telnyx_password` - SIP password (credential auth)
153
- - `@credential_token` - JWT authentication token (token auth)
154
- - `@push_token` - Push notification device token
155
-
156
- **Note**: These are managed automatically by the library. You only need to call `login()` once, and the library will handle storage and future reconnections.
157
-
158
- ##### Auto-Reconnection
159
-
160
- ```tsx
161
- // Automatically reconnects using internally stored credentials or token
162
- const success = await voipClient.loginFromStoredConfig();
163
-
164
- if (!success) {
165
- // No stored authentication data found, show login UI
166
- console.log('Please log in again');
167
- }
168
- ```
169
-
170
- **When Auto-Reconnection Happens:**
171
-
172
- - App launches from background/terminated state
173
- - Push notification received while disconnected
174
- - Network reconnection after connectivity loss
175
- - App state changes (foreground/background transitions)
176
-
177
- **Demo App Note**: When using the library in a demo application, the `TelnyxLoginForm` component may do additional storage for UI convenience (pre-filling login forms). This is separate from the library's internal authentication storage and is not required for production apps.
178
-
179
- ##### Manual Storage Management (Advanced Use Only)
180
-
181
- If you need to clear stored authentication data manually:
182
-
183
- ```tsx
184
- import AsyncStorage from '@react-native-async-storage/async-storage';
185
-
186
- // Clear all Telnyx authentication data
187
- await AsyncStorage.multiRemove([
188
- '@telnyx_username',
189
- '@telnyx_password',
190
- '@credential_token',
191
- '@push_token',
192
- ]);
193
- ```
194
-
195
- **Important**: This is typically not needed. The library manages authentication storage automatically. Only use this for advanced scenarios like implementing a "logout" feature that clears all stored data.
196
-
197
- ### Native Integration
198
-
199
- The library provides complete native integration for both platforms. These integrations are required for production apps using the library.
200
-
201
- #### Android Integration
202
-
203
- ##### 1. MainActivity Setup
204
-
205
- Your app's MainActivity should extend `TelnyxMainActivity` for automatic push notification handling:
206
-
207
- ```kotlin
208
- // In your app's MainActivity.kt
209
- import com.telnyx.react_voice_commons.TelnyxMainActivity
210
-
211
- class MainActivity : TelnyxMainActivity() {
212
- // Your app-specific code
213
-
214
- override fun onHandleIntent(intent: Intent) {
215
- super.onHandleIntent(intent)
216
- // Handle any additional intent processing
217
- }
218
- }
219
- ```
220
-
221
- The `TelnyxMainActivity` provides:
222
-
223
- - Automatic push notification intent handling
224
- - Call action processing (Answer/Decline from notifications)
225
- - Proper lifecycle management for VoIP functionality
226
- - Integration with `VoicePnManager` for push notification state
227
-
228
- ##### 2. Push Notification Setup
229
-
230
- 1. Place `google-services.json` in the project root
231
- 2. Register background message handler:
232
-
233
- ```tsx
234
- import messaging from '@react-native-firebase/messaging';
235
- import { TelnyxVoiceApp } from '@telnyx/react-voice-commons-sdk';
236
-
237
- messaging().setBackgroundMessageHandler(async (remoteMessage) => {
238
- await TelnyxVoiceApp.handleBackgroundPush(remoteMessage.data);
239
- });
240
- ```
241
-
242
- #### iOS Integration
243
-
244
- ##### 1. AppDelegate Setup
245
-
246
- Your AppDelegate only needs to implement `PKPushRegistryDelegate` for VoIP push notifications. CallKit integration is automatically handled by CallBridge:
247
-
248
- ```swift
249
- import PushKit
250
- import TelnyxVoiceCommons
251
-
252
- @UIApplicationMain
253
- public class AppDelegate: ExpoAppDelegate, PKPushRegistryDelegate {
254
-
255
- public override func application(
256
- _ application: UIApplication,
257
- didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
258
- ) -> Bool {
259
- // Your existing setup...
260
-
261
- // Initialize VoIP push registry via react-voice-commons
262
- TelnyxVoipPushHandler.initializeVoipRegistration()
263
-
264
- return super.application(application, didFinishLaunchingWithOptions: launchOptions)
265
- }
266
-
267
- // MARK: - VoIP Push Notifications
268
- public func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) {
269
- TelnyxVoipPushHandler.shared.handleVoipTokenUpdate(pushCredentials, type: type)
270
- }
271
-
272
- public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
273
- TelnyxVoipPushHandler.shared.handleVoipPush(payload, type: type, completion: completion)
274
- }
275
- }
276
- ```
277
-
278
- **Note**: CallKit integration (CXProvider, CXProviderDelegate, audio session management) is automatically handled by the internal CallBridge component. You don't need to implement any CallKit delegate methods manually.
279
-
280
- ##### 2. VoIP Push Certificate Setup
281
-
282
- - Configure VoIP push certificates in your Apple Developer account
283
- - The `TelnyxVoipPushHandler` automatically handles token registration and push processing
284
- - CallKit integration is automatically managed by CallBridge - no manual setup required
285
-
286
- #### Key Native Features Integrated
287
-
288
- 1. **Push Notification Handling**: Both platforms handle background push notifications properly
289
- 2. **Native Call UI**: CallKit (iOS, managed by CallBridge) and ConnectionService (Android) integration
290
- 3. **Audio Session Management**: Automatic audio session handling for VoIP calls via CallBridge
291
- 4. **Background Processing**: Seamless app state transitions and background call handling
292
- 5. **Intent Processing**: Android intent handling for notification actions (Answer/Decline)
293
- 6. **Token Management**: Automatic push token registration and updates
294
-
295
- ## Running the Demo Application
296
-
297
- ### Prerequisites
298
-
299
- - Node.js and npm
300
- - Expo CLI
301
- - iOS development: Xcode
302
- - Android development: Android Studio
303
-
304
- ### Installation and Setup
305
-
306
- 1. **Remove global Expo CLI** (if previously installed):
307
-
308
- ```bash
309
- npm uninstall -g expo
310
- ```
311
-
312
- 2. **Install dependencies** (including local Expo):
313
-
314
- ```bash
315
- npm install
316
- ```
317
-
318
- 3. **Run Expo install** to ensure all dependencies are properly configured:
319
-
320
- ```bash
321
- npx expo install
322
- ```
323
-
324
- 4. **Configure Firebase for Android**:
325
- - Download the `google-services.json` file from your Firebase project
326
- - Place it in the root directory of the project
327
-
328
- 5. **Prebuild the project**:
329
-
330
- ```bash
331
- npx expo prebuild
332
- ```
333
-
334
- 6. **Install iOS dependencies** (required for iOS):
335
- ```bash
336
- cd ios && pod install && cd ..
337
- ```
338
-
339
- ### Running the Application
340
-
341
- 1. **Start Metro bundler** (in a separate terminal):
342
-
343
- ```bash
344
- npx expo start --clear --reset-cache
345
- ```
346
-
347
- 2. **Run on iOS**:
348
-
349
- ```bash
350
- npx expo run:ios
351
- ```
352
-
353
- 3. **Run on Android**:
354
- ```bash
355
- npx expo run:android
356
- ```
357
-
358
- > **Note**: Make sure you have the necessary development environment set up for iOS (Xcode) or Android (Android Studio) before running the respective commands.
359
-
360
- ### Demo App Features
361
-
362
- Once running, the demo app provides:
363
-
364
- - **Login Form**: Enter your Telnyx SIP credentials or token
365
- - **Dialer Interface**: Make outgoing calls with a native dialer UI
366
- - **Call Management**: Answer, decline, hold, mute, and transfer calls
367
- - **Native Call UI**: Integrated CallKit (iOS) and ConnectionService (Android)
368
- - **Push Notifications**: Receive calls when app is in background or terminated
369
- - **Multiple Call Support**: Handle multiple simultaneous calls
370
- - **Background Handling**: Seamless app state transitions
371
-
372
- ### Configuration
373
-
374
- The demo app includes debug logging enabled by default:
375
-
376
- ```tsx
377
- // Enable debug logging for the Telnyx SDK
378
- if (__DEV__) {
379
- log.setLevel('debug');
380
- (global as any).__TELNYX_DEBUG__ = true;
381
- }
382
- ```
383
-
384
- This provides detailed logging for:
385
-
386
- - Connection state changes
387
- - Call state transitions
388
- - Push notification processing
389
- - Background lifecycle events
390
-
391
- ## Troubleshooting
392
-
393
- ### iOS Connection Issues (First Run)
394
-
395
- If you encounter network connection errors on iOS:
396
-
397
- ```bash
398
- # Try clearing cache and resetting
399
- npx expo start --clear --reset-cache
400
-
401
- # Or use tunnel mode
402
- npx expo start --tunnel
403
-
404
- # Or specify host explicitly
405
- npx expo start --host lan
406
- ```
407
-
408
- ### iOS VoIP Push Notification Issues
409
-
410
- If you see VoIP-related crashes on iOS, ensure your AppDelegate.swift includes the VoIP push notification delegate methods. The project includes these by default, but if you encounter issues, rebuild the iOS project:
411
-
412
- ```bash
413
- npx expo prebuild --platform ios --clean
414
- npx expo run:ios
415
- ```
416
-
417
- ### Common Integration Issues
418
-
419
- #### Double Login
420
-
421
- Ensure you're not calling login methods manually when using `TelnyxVoiceApp` with auto-reconnection enabled.
422
-
423
- #### Background Disconnection
424
-
425
- Check if `enableAutoReconnect` is set appropriately for your use case in the `TelnyxVoiceApp` configuration.
426
-
427
- #### Push Notifications Not Working
428
-
429
- - **Android**:
430
- - Verify `google-services.json` is in the correct location and Firebase is properly configured
431
- - Ensure your MainActivity extends `TelnyxMainActivity`
432
- - Check that `VoicePnManager` is properly handling push actions
433
- - **iOS**:
434
- - Ensure VoIP push certificates are configured in your Apple Developer account
435
- - Verify AppDelegate implements `PKPushRegistryDelegate` and delegates to `TelnyxVoipPushHandler`
436
- - Check that `TelnyxVoipPushHandler.initializeVoipRegistration()` is called in `didFinishLaunchingWithOptions`
437
- - **Both**: Check that background message handlers are properly registered
438
-
439
- #### Native Integration Issues
440
-
441
- - **Android**: Ensure MainActivity extends `TelnyxMainActivity` for proper intent handling
442
- - **iOS**: Verify AppDelegate implements `PKPushRegistryDelegate` and delegates to `TelnyxVoipPushHandler`
443
- - **CallKit**: On iOS, CallKit integration is automatically handled by CallBridge - no manual setup required
444
-
445
- #### Audio Issues
446
-
447
- - **iOS**: Audio session management is automatically handled by CallBridge
448
- - **Android**: Verify ConnectionService is properly configured for audio routing
449
- - **Both**: Ensure proper audio permissions are granted
450
-
451
- #### Memory Leaks
452
-
453
- Ensure you're unsubscribing from RxJS observables in your React components:
454
-
455
- ```tsx
456
- useEffect(() => {
457
- const subscription = voipClient.connectionState$.subscribe(handleStateChange);
458
- return () => subscription.unsubscribe();
459
- }, []);
460
- }, []);
461
- ```
462
-
463
- ## Documentation
464
-
465
- For complete API documentation and advanced usage patterns, see the [TelnyxVoiceApp Documentation](./react-voice-commons-sdk/TELNYX_VOICE_APP.md).
466
-
467
- ## License
468
-
469
- MIT License - see LICENSE file for details.
1
+ # Telnyx React Voice Commons SDK
2
+
3
+ A high-level, state-agnostic, drop-in module for the Telnyx React Native SDK that simplifies WebRTC voice calling integration. This library provides a comprehensive solution for building VoIP applications with native call UI support, push notifications, and seamless background handling.
4
+
5
+ ### Key Features
6
+
7
+ - **TelnyxVoiceApp Integration**: Automatic lifecycle management and push notification handling
8
+ - **Native Call UI**: CallKit (iOS) and ConnectionService (Android) integration
9
+ - **Background Handling**: Seamless app state transitions and background call processing
10
+ - **Push Notifications**: Firebase (Android) and APNs (iOS) integration
11
+ - **Reactive State Management**: RxJS-based state streams for real-time UI updates
12
+ - **TypeScript Support**: Full TypeScript definitions for better developer experience
13
+ - **Cross-Platform**: Built for both iOS and Android with React Native
14
+
15
+ ## About @telnyx/react-voice-commons-sdk
16
+
17
+ The `@telnyx/react-voice-commons-sdk` library provides:
18
+
19
+ - **Headless Operation**: Core library that can establish and manage call state programmatically
20
+ - **Reactive Streams**: All state exposed via RxJS observables for easy integration
21
+ - **Simplified API**: Single facade class (`TelnyxVoipClient`) that hides underlying complexity
22
+ - **Automatic Lifecycle Management**: Background/foreground handling with `TelnyxVoiceApp` component
23
+ - **Call State Management**: Central state machine for managing multiple calls
24
+ - **Session Management**: Automatic connection lifecycle with reconnection logic
25
+ - **Push Notification Support**: Built-in handling for background push notifications
26
+ - **TypeScript Support**: Full TypeScript definitions for better developer experience
27
+
28
+ ## Integration Guide
29
+
30
+ ### Basic Setup
31
+
32
+ Integrate the library using the `TelnyxVoiceApp` component for automatic lifecycle management:
33
+
34
+ ```tsx
35
+ import { TelnyxVoiceApp, createTelnyxVoipClient } from '@telnyx/react-voice-commons-sdk';
36
+
37
+ // Create the VoIP client instance
38
+ const voipClient = createTelnyxVoipClient({
39
+ enableAppStateManagement: true, // Optional: Enable automatic app state management (default: true)
40
+ debug: true, // Optional: Enable debug logging
41
+ });
42
+
43
+ export default function App() {
44
+ return (
45
+ <TelnyxVoiceApp voipClient={voipClient} enableAutoReconnect={false} debug={true}>
46
+ <YourAppContent />
47
+ </TelnyxVoiceApp>
48
+ );
49
+ }
50
+ ```
51
+
52
+ ### Core Components
53
+
54
+ #### 1. VoIP Client Configuration
55
+
56
+ ```tsx
57
+ const voipClient = createTelnyxVoipClient({
58
+ enableAppStateManagement: true, // Optional: Enable automatic app state management (default: true)
59
+ debug: true, // Optional: Enable debug logging
60
+ });
61
+ ```
62
+
63
+ **Configuration Options Explained:**
64
+
65
+ - **`enableAppStateManagement: true`** - **Optional (default: true)**: Enables automatic background/foreground app state management. When enabled, the library automatically disconnects when the app goes to background (unless there's an active call) and handles reconnection logic. Set to `false` if you want to handle app lifecycle manually.
66
+ - **`debug: true`** - **Optional**: Enables detailed logging for connection states, call transitions, and push notification processing. Useful for development and troubleshooting.
67
+
68
+ #### 2. TelnyxVoiceApp Wrapper
69
+
70
+ The `TelnyxVoiceApp` component handles:
71
+
72
+ - Automatic background/foreground lifecycle management
73
+ - Push notification processing from terminated state
74
+ - Login state management with automatic reconnection
75
+ - Background client management for push notifications
76
+
77
+ #### 3. Reactive State Management
78
+
79
+ ```tsx
80
+ // Listen to connection state
81
+ voipClient.connectionState$.subscribe((state) => {
82
+ console.log('Connection state:', state);
83
+ });
84
+
85
+ // Listen to active calls
86
+ voipClient.calls$.subscribe((calls) => {
87
+ console.log('Active calls:', calls);
88
+ });
89
+
90
+ // Handle individual call state
91
+ call.callState$.subscribe((state) => {
92
+ console.log('Call state:', state);
93
+ });
94
+ ```
95
+
96
+ #### 4. Call Management
97
+
98
+ ```tsx
99
+ // Make a call
100
+ const call = await voipClient.newCall('1234567890');
101
+
102
+ // Answer incoming call
103
+ await call.answer();
104
+
105
+ // Control call
106
+ await call.mute();
107
+ await call.hold();
108
+ await call.hangup();
109
+ ```
110
+
111
+ ### Authentication & Persistent Storage
112
+
113
+ The library supports both credential-based and token-based authentication with automatic persistence for seamless reconnection.
114
+
115
+ #### Authentication Methods
116
+
117
+ ##### 1. Credential-Based Authentication
118
+
119
+ ```tsx
120
+ import { createCredentialConfig } from '@telnyx/react-voice-commons-sdk';
121
+
122
+ const config = createCredentialConfig('your_sip_username', 'your_sip_password', {
123
+ debug: true,
124
+ pushNotificationDeviceToken: 'your_device_token',
125
+ });
126
+
127
+ await voipClient.login(config);
128
+ ```
129
+
130
+ ##### 2. Token-Based Authentication
131
+
132
+ ```tsx
133
+ import { createTokenConfig } from '@telnyx/react-voice-commons-sdk';
134
+
135
+ const config = createTokenConfig('your_jwt_token', {
136
+ debug: true,
137
+ pushNotificationDeviceToken: 'your_device_token',
138
+ });
139
+
140
+ await voipClient.loginWithToken(config);
141
+ ```
142
+
143
+ #### Automatic Storage & Reconnection
144
+
145
+ The library automatically stores authentication data securely for seamless reconnection. **You don't need to manually manage these storage keys** - the library handles everything internally.
146
+
147
+ ##### Internal Storage (Managed Automatically)
148
+
149
+ The library uses these AsyncStorage keys internally:
150
+
151
+ - `@telnyx_username` - SIP username (credential auth)
152
+ - `@telnyx_password` - SIP password (credential auth)
153
+ - `@credential_token` - JWT authentication token (token auth)
154
+ - `@push_token` - Push notification device token
155
+
156
+ **Note**: These are managed automatically by the library. You only need to call `login()` once, and the library will handle storage and future reconnections.
157
+
158
+ ##### Auto-Reconnection
159
+
160
+ ```tsx
161
+ // Automatically reconnects using internally stored credentials or token
162
+ const success = await voipClient.loginFromStoredConfig();
163
+
164
+ if (!success) {
165
+ // No stored authentication data found, show login UI
166
+ console.log('Please log in again');
167
+ }
168
+ ```
169
+
170
+ **When Auto-Reconnection Happens:**
171
+
172
+ - App launches from background/terminated state
173
+ - Push notification received while disconnected
174
+ - Network reconnection after connectivity loss
175
+ - App state changes (foreground/background transitions)
176
+
177
+ **Demo App Note**: When using the library in a demo application, the `TelnyxLoginForm` component may do additional storage for UI convenience (pre-filling login forms). This is separate from the library's internal authentication storage and is not required for production apps.
178
+
179
+ ##### Manual Storage Management (Advanced Use Only)
180
+
181
+ If you need to clear stored authentication data manually:
182
+
183
+ ```tsx
184
+ import AsyncStorage from '@react-native-async-storage/async-storage';
185
+
186
+ // Clear all Telnyx authentication data
187
+ await AsyncStorage.multiRemove([
188
+ '@telnyx_username',
189
+ '@telnyx_password',
190
+ '@credential_token',
191
+ '@push_token',
192
+ ]);
193
+ ```
194
+
195
+ **Important**: This is typically not needed. The library manages authentication storage automatically. Only use this for advanced scenarios like implementing a "logout" feature that clears all stored data.
196
+
197
+ ### Native Integration
198
+
199
+ The library provides complete native integration for both platforms. These integrations are required for production apps using the library.
200
+
201
+ #### Android Integration
202
+
203
+ ##### 1. MainActivity Setup
204
+
205
+ Your app's MainActivity should extend `TelnyxMainActivity` for automatic push notification handling:
206
+
207
+ ```kotlin
208
+ // In your app's MainActivity.kt
209
+ import com.telnyx.react_voice_commons.TelnyxMainActivity
210
+
211
+ class MainActivity : TelnyxMainActivity() {
212
+ // Your app-specific code
213
+
214
+ override fun onHandleIntent(intent: Intent) {
215
+ super.onHandleIntent(intent)
216
+ // Handle any additional intent processing
217
+ }
218
+ }
219
+ ```
220
+
221
+ The `TelnyxMainActivity` provides:
222
+
223
+ - Automatic push notification intent handling
224
+ - Call action processing (Answer/Decline from notifications)
225
+ - Proper lifecycle management for VoIP functionality
226
+ - Integration with `VoicePnManager` for push notification state
227
+
228
+ ##### 2. Push Notification Setup
229
+
230
+ 1. Place `google-services.json` in the project root
231
+ 2. Register background message handler:
232
+
233
+ ```tsx
234
+ import messaging from '@react-native-firebase/messaging';
235
+ import { TelnyxVoiceApp } from '@telnyx/react-voice-commons-sdk';
236
+
237
+ messaging().setBackgroundMessageHandler(async (remoteMessage) => {
238
+ await TelnyxVoiceApp.handleBackgroundPush(remoteMessage.data);
239
+ });
240
+ ```
241
+
242
+ #### iOS Integration
243
+
244
+ ##### 1. AppDelegate Setup
245
+
246
+ Your AppDelegate only needs to implement `PKPushRegistryDelegate` for VoIP push notifications. CallKit integration is automatically handled by CallBridge:
247
+
248
+ ```swift
249
+ import PushKit
250
+ import TelnyxVoiceCommons
251
+
252
+ @UIApplicationMain
253
+ public class AppDelegate: ExpoAppDelegate, PKPushRegistryDelegate {
254
+
255
+ public override func application(
256
+ _ application: UIApplication,
257
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
258
+ ) -> Bool {
259
+ // Your existing setup...
260
+
261
+ // Initialize VoIP push registry via react-voice-commons
262
+ TelnyxVoipPushHandler.initializeVoipRegistration()
263
+
264
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
265
+ }
266
+
267
+ // MARK: - VoIP Push Notifications
268
+ public func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) {
269
+ TelnyxVoipPushHandler.shared.handleVoipTokenUpdate(pushCredentials, type: type)
270
+ }
271
+
272
+ public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
273
+ TelnyxVoipPushHandler.shared.handleVoipPush(payload, type: type, completion: completion)
274
+ }
275
+ }
276
+ ```
277
+
278
+ **Note**: CallKit integration (CXProvider, CXProviderDelegate, audio session management) is automatically handled by the internal CallBridge component. You don't need to implement any CallKit delegate methods manually.
279
+
280
+ ##### 2. VoIP Push Certificate Setup
281
+
282
+ - Configure VoIP push certificates in your Apple Developer account
283
+ - The `TelnyxVoipPushHandler` automatically handles token registration and push processing
284
+ - CallKit integration is automatically managed by CallBridge - no manual setup required
285
+
286
+ #### Key Native Features Integrated
287
+
288
+ 1. **Push Notification Handling**: Both platforms handle background push notifications properly
289
+ 2. **Native Call UI**: CallKit (iOS, managed by CallBridge) and ConnectionService (Android) integration
290
+ 3. **Audio Session Management**: Automatic audio session handling for VoIP calls via CallBridge
291
+ 4. **Background Processing**: Seamless app state transitions and background call handling
292
+ 5. **Intent Processing**: Android intent handling for notification actions (Answer/Decline)
293
+ 6. **Token Management**: Automatic push token registration and updates
294
+
295
+ ## Running the Demo Application
296
+
297
+ ### Prerequisites
298
+
299
+ - Node.js and npm
300
+ - Expo CLI
301
+ - iOS development: Xcode
302
+ - Android development: Android Studio
303
+
304
+ ### Installation and Setup
305
+
306
+ 1. **Remove global Expo CLI** (if previously installed):
307
+
308
+ ```bash
309
+ npm uninstall -g expo
310
+ ```
311
+
312
+ 2. **Install dependencies** (including local Expo):
313
+
314
+ ```bash
315
+ npm install
316
+ ```
317
+
318
+ 3. **Run Expo install** to ensure all dependencies are properly configured:
319
+
320
+ ```bash
321
+ npx expo install
322
+ ```
323
+
324
+ 4. **Configure Firebase for Android**:
325
+ - Download the `google-services.json` file from your Firebase project
326
+ - Place it in the root directory of the project
327
+
328
+ 5. **Prebuild the project**:
329
+
330
+ ```bash
331
+ npx expo prebuild
332
+ ```
333
+
334
+ 6. **Install iOS dependencies** (required for iOS):
335
+ ```bash
336
+ cd ios && pod install && cd ..
337
+ ```
338
+
339
+ ### Running the Application
340
+
341
+ 1. **Start Metro bundler** (in a separate terminal):
342
+
343
+ ```bash
344
+ npx expo start --clear --reset-cache
345
+ ```
346
+
347
+ 2. **Run on iOS**:
348
+
349
+ ```bash
350
+ npx expo run:ios
351
+ ```
352
+
353
+ 3. **Run on Android**:
354
+ ```bash
355
+ npx expo run:android
356
+ ```
357
+
358
+ > **Note**: Make sure you have the necessary development environment set up for iOS (Xcode) or Android (Android Studio) before running the respective commands.
359
+
360
+ ### Demo App Features
361
+
362
+ Once running, the demo app provides:
363
+
364
+ - **Login Form**: Enter your Telnyx SIP credentials or token
365
+ - **Dialer Interface**: Make outgoing calls with a native dialer UI
366
+ - **Call Management**: Answer, decline, hold, mute, and transfer calls
367
+ - **Native Call UI**: Integrated CallKit (iOS) and ConnectionService (Android)
368
+ - **Push Notifications**: Receive calls when app is in background or terminated
369
+ - **Multiple Call Support**: Handle multiple simultaneous calls
370
+ - **Background Handling**: Seamless app state transitions
371
+
372
+ ### Configuration
373
+
374
+ The demo app includes debug logging enabled by default:
375
+
376
+ ```tsx
377
+ // Enable debug logging for the Telnyx SDK
378
+ if (__DEV__) {
379
+ log.setLevel('debug');
380
+ (global as any).__TELNYX_DEBUG__ = true;
381
+ }
382
+ ```
383
+
384
+ This provides detailed logging for:
385
+
386
+ - Connection state changes
387
+ - Call state transitions
388
+ - Push notification processing
389
+ - Background lifecycle events
390
+
391
+ ## Troubleshooting
392
+
393
+ ### iOS Connection Issues (First Run)
394
+
395
+ If you encounter network connection errors on iOS:
396
+
397
+ ```bash
398
+ # Try clearing cache and resetting
399
+ npx expo start --clear --reset-cache
400
+
401
+ # Or use tunnel mode
402
+ npx expo start --tunnel
403
+
404
+ # Or specify host explicitly
405
+ npx expo start --host lan
406
+ ```
407
+
408
+ ### iOS VoIP Push Notification Issues
409
+
410
+ If you see VoIP-related crashes on iOS, ensure your AppDelegate.swift includes the VoIP push notification delegate methods. The project includes these by default, but if you encounter issues, rebuild the iOS project:
411
+
412
+ ```bash
413
+ npx expo prebuild --platform ios --clean
414
+ npx expo run:ios
415
+ ```
416
+
417
+ ### Common Integration Issues
418
+
419
+ #### Double Login
420
+
421
+ Ensure you're not calling login methods manually when using `TelnyxVoiceApp` with auto-reconnection enabled.
422
+
423
+ #### Background Disconnection
424
+
425
+ Check if `enableAutoReconnect` is set appropriately for your use case in the `TelnyxVoiceApp` configuration.
426
+
427
+ #### Push Notifications Not Working
428
+
429
+ - **Android**:
430
+ - Verify `google-services.json` is in the correct location and Firebase is properly configured
431
+ - Ensure your MainActivity extends `TelnyxMainActivity`
432
+ - Check that `VoicePnManager` is properly handling push actions
433
+ - **iOS**:
434
+ - Ensure VoIP push certificates are configured in your Apple Developer account
435
+ - Verify AppDelegate implements `PKPushRegistryDelegate` and delegates to `TelnyxVoipPushHandler`
436
+ - Check that `TelnyxVoipPushHandler.initializeVoipRegistration()` is called in `didFinishLaunchingWithOptions`
437
+ - **Both**: Check that background message handlers are properly registered
438
+
439
+ #### Native Integration Issues
440
+
441
+ - **Android**: Ensure MainActivity extends `TelnyxMainActivity` for proper intent handling
442
+ - **iOS**: Verify AppDelegate implements `PKPushRegistryDelegate` and delegates to `TelnyxVoipPushHandler`
443
+ - **CallKit**: On iOS, CallKit integration is automatically handled by CallBridge - no manual setup required
444
+
445
+ #### Audio Issues
446
+
447
+ - **iOS**: Audio session management is automatically handled by CallBridge
448
+ - **Android**: Verify ConnectionService is properly configured for audio routing
449
+ - **Both**: Ensure proper audio permissions are granted
450
+
451
+ #### Memory Leaks
452
+
453
+ Ensure you're unsubscribing from RxJS observables in your React components:
454
+
455
+ ```tsx
456
+ useEffect(() => {
457
+ const subscription = voipClient.connectionState$.subscribe(handleStateChange);
458
+ return () => subscription.unsubscribe();
459
+ }, []);
460
+ }, []);
461
+ ```
462
+
463
+ ## Documentation
464
+
465
+ For complete API documentation and advanced usage patterns, see the [TelnyxVoiceApp Documentation](./react-voice-commons-sdk/TELNYX_VOICE_APP.md).
466
+
467
+ ## License
468
+
469
+ MIT License - see LICENSE file for details.