livevoice-sdk-react-native 1.0.1 → 1.0.3

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 (53) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/generated/java/io/livevoice/react/NativeLiveVoiceSdkSpec.java +4 -0
  3. package/android/generated/jni/RNLiveVoiceSpec-generated.cpp +6 -0
  4. package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI-generated.cpp +7 -0
  5. package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +9 -0
  6. package/android/gradle.properties +1 -1
  7. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +14 -1
  8. package/android/src/main/java/io/livevoice/react/__SDK.kt +6 -0
  9. package/ios/LivevoiceSdkReactNative.mm +18 -2
  10. package/ios/__SDK.h +4 -0
  11. package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec-generated.mm +7 -0
  12. package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec.h +1 -0
  13. package/ios/generated/RNLiveVoiceSpecJSI-generated.cpp +7 -0
  14. package/ios/generated/RNLiveVoiceSpecJSI.h +9 -0
  15. package/lib/commonjs/components/AudioOutputSwitchView.js +5 -1
  16. package/lib/commonjs/components/AudioOutputSwitchView.js.map +1 -1
  17. package/lib/commonjs/components/BrandingView.js +8 -8
  18. package/lib/commonjs/components/BrandingView.js.map +1 -1
  19. package/lib/commonjs/components/LiveVoiceView.js +15 -3
  20. package/lib/commonjs/components/LiveVoiceView.js.map +1 -1
  21. package/lib/commonjs/index.js +22 -5
  22. package/lib/commonjs/index.js.map +1 -1
  23. package/lib/commonjs/specs/NativeLiveVoiceSdk.js.map +1 -1
  24. package/lib/module/components/AudioOutputSwitchView.js +5 -1
  25. package/lib/module/components/AudioOutputSwitchView.js.map +1 -1
  26. package/lib/module/components/BrandingView.js +9 -9
  27. package/lib/module/components/BrandingView.js.map +1 -1
  28. package/lib/module/components/LiveVoiceView.js +15 -3
  29. package/lib/module/components/LiveVoiceView.js.map +1 -1
  30. package/lib/module/index.js +19 -4
  31. package/lib/module/index.js.map +1 -1
  32. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
  33. package/lib/typescript/commonjs/src/components/AudioOutputSwitchView.d.ts.map +1 -1
  34. package/lib/typescript/commonjs/src/components/BrandingView.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/src/components/LiveVoiceView.d.ts.map +1 -1
  36. package/lib/typescript/commonjs/src/index.d.ts +24 -4
  37. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  38. package/lib/typescript/commonjs/src/specs/NativeLiveVoiceSdk.d.ts +1 -0
  39. package/lib/typescript/commonjs/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
  40. package/lib/typescript/module/src/components/AudioOutputSwitchView.d.ts.map +1 -1
  41. package/lib/typescript/module/src/components/BrandingView.d.ts.map +1 -1
  42. package/lib/typescript/module/src/components/LiveVoiceView.d.ts.map +1 -1
  43. package/lib/typescript/module/src/index.d.ts +24 -4
  44. package/lib/typescript/module/src/index.d.ts.map +1 -1
  45. package/lib/typescript/module/src/specs/NativeLiveVoiceSdk.d.ts +1 -0
  46. package/lib/typescript/module/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
  47. package/livevoice-sdk-react-native.podspec +1 -1
  48. package/package.json +5 -4
  49. package/src/components/AudioOutputSwitchView.tsx +10 -9
  50. package/src/components/BrandingView.tsx +28 -13
  51. package/src/components/LiveVoiceView.tsx +39 -30
  52. package/src/index.tsx +23 -8
  53. package/src/specs/NativeLiveVoiceSdk.ts +2 -0
package/src/index.tsx CHANGED
@@ -184,27 +184,33 @@ export function stopSubtitles(): void {
184
184
 
185
185
  /**
186
186
  * Handle changes of the audio output.
187
+ *
188
+ * @returns {object} - An object with a `remove` method to unsubscribe from the event.
187
189
  */
188
- export function onAudioOutputChanged(handler: (useSpeaker: boolean) => void): void {
189
- LiveVoiceSdkReactNative.onAudioOutputChanged((data: boolean) => {
190
+ export function onAudioOutputChanged(handler: (useSpeaker: boolean) => void): { remove: () => void; } {
191
+ return LiveVoiceSdkReactNative.onAudioOutputChanged((data: boolean) => {
190
192
  handler(data);
191
193
  });
192
194
  }
193
195
 
194
196
  /**
195
197
  * Handle changes of the UI state.
198
+ *
199
+ * @returns {object} - An object with a `remove` method to unsubscribe from the event.
196
200
  */
197
- export function onUiStateChanged(handler: (arg: UiState) => void): void {
198
- LiveVoiceSdkReactNative.onUiStateChanged((data: string) => {
201
+ export function onUiStateChanged(handler: (arg: UiState) => void): { remove: () => void; } {
202
+ return LiveVoiceSdkReactNative.onUiStateChanged((data: string) => {
199
203
  handler(JSON.parse(data))
200
204
  });
201
205
  }
202
206
 
203
207
  /**
204
208
  * Handle changes of the available subtitles.
209
+ *
210
+ * @returns { object } - An object with a`remove` method to unsubscribe from the event.
205
211
  */
206
- export function onAvailableSubtitleConfigsChanged(handler: (arg: AvailableSubtitleConfigs) => void): void {
207
- LiveVoiceSdkReactNative.onAvailableSubtitleConfigsChanged((data: string) => {
212
+ export function onAvailableSubtitleConfigsChanged(handler: (arg: AvailableSubtitleConfigs) => void): { remove: () => void; } {
213
+ return LiveVoiceSdkReactNative.onAvailableSubtitleConfigsChanged((data: string) => {
208
214
  const mapOfSubtitles: AvailableSubtitleConfigs = JSON.parse(data);
209
215
  handler(mapOfSubtitles)
210
216
  })
@@ -212,10 +218,19 @@ export function onAvailableSubtitleConfigsChanged(handler: (arg: AvailableSubtit
212
218
 
213
219
  /**
214
220
  * Handle changes of the available subtitles.
221
+ *
222
+ * @returns {object} - An object with a `remove` method to unsubscribe from the event.
215
223
  */
216
- export function onSubtitlesChanged(handler: (arg: [String]) => void): void {
217
- LiveVoiceSdkReactNative.onSubtitlesChanged((data: string) => {
224
+ export function onSubtitlesChanged(handler: (arg: [String]) => void): { remove: () => void; } {
225
+ return LiveVoiceSdkReactNative.onSubtitlesChanged((data: string) => {
218
226
  const mapOfSubtitles: [String] = JSON.parse(data);
219
227
  handler(mapOfSubtitles)
220
228
  })
229
+ }
230
+
231
+ /**
232
+ * Open the LiveVoice website in the device's default browser.
233
+ */
234
+ export function openLiveVoiceWebsite(): void {
235
+ return LiveVoiceSdkReactNative.openLiveVoiceWebsite();
221
236
  }
@@ -39,6 +39,8 @@ export interface Spec extends TurboModule {
39
39
  startSubtitles(channelId: number, languageCode: string | null): void
40
40
  stopSubtitles(): void
41
41
 
42
+ openLiveVoiceWebsite(): void
43
+
42
44
  // Events
43
45
 
44
46
  readonly onUiStateChanged: EventEmitter<string>