livevoice-sdk-react-native 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +119 -7
  2. package/android/build.gradle +14 -3
  3. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +89 -123
  4. package/android/src/main/java/io/livevoice/react/__SDK.kt +16 -2
  5. package/ios/LiveVoiceSdkReactNative.mm +110 -37
  6. package/ios/__SDK.h +16 -2
  7. package/lib/module/components/AudioOutputSwitchView.js +13 -13
  8. package/lib/module/components/AudioOutputSwitchView.js.map +1 -1
  9. package/lib/module/components/BrandingView.js +13 -11
  10. package/lib/module/components/BrandingView.js.map +1 -1
  11. package/lib/module/components/ChannelView.js +14 -11
  12. package/lib/module/components/ChannelView.js.map +1 -1
  13. package/lib/module/components/ErrorView.js +12 -10
  14. package/lib/module/components/ErrorView.js.map +1 -1
  15. package/lib/module/components/LiveVoiceView.js +141 -72
  16. package/lib/module/components/LiveVoiceView.js.map +1 -1
  17. package/lib/module/components/PlayButtonView.js +12 -10
  18. package/lib/module/components/PlayButtonView.js.map +1 -1
  19. package/lib/module/components/ReconnectingView.js +16 -13
  20. package/lib/module/components/ReconnectingView.js.map +1 -1
  21. package/lib/module/components/WarningView.js +12 -10
  22. package/lib/module/components/WarningView.js.map +1 -1
  23. package/lib/module/components/index.js +12 -10
  24. package/lib/module/components/index.js.map +1 -1
  25. package/lib/module/index.js +14 -220
  26. package/lib/module/index.js.map +1 -1
  27. package/lib/module/sdk/LiveVoiceSdk.js +371 -0
  28. package/lib/module/sdk/LiveVoiceSdk.js.map +1 -0
  29. package/lib/module/sdk/LiveVoiceState.js +66 -0
  30. package/lib/module/sdk/LiveVoiceState.js.map +1 -0
  31. package/lib/module/specs/NativeLiveVoiceSdk.js +12 -10
  32. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
  33. package/lib/module/util/Colors.js +12 -10
  34. package/lib/module/util/Colors.js.map +1 -1
  35. package/lib/module/util/ForegroundServiceConfig.js +21 -11
  36. package/lib/module/util/ForegroundServiceConfig.js.map +1 -1
  37. package/lib/module/util/PlayingState.js +12 -10
  38. package/lib/module/util/PlayingState.js.map +1 -1
  39. package/lib/module/util/Translations.js +12 -10
  40. package/lib/module/util/Translations.js.map +1 -1
  41. package/lib/module/util/logger.js +76 -0
  42. package/lib/module/util/logger.js.map +1 -0
  43. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +1 -1
  44. package/lib/typescript/src/components/BrandingView.d.ts.map +1 -1
  45. package/lib/typescript/src/components/ChannelView.d.ts.map +1 -1
  46. package/lib/typescript/src/components/ErrorView.d.ts.map +1 -1
  47. package/lib/typescript/src/components/LiveVoiceView.d.ts +22 -0
  48. package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -1
  49. package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -1
  50. package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -1
  51. package/lib/typescript/src/components/WarningView.d.ts.map +1 -1
  52. package/lib/typescript/src/components/index.d.ts.map +1 -1
  53. package/lib/typescript/src/index.d.ts +6 -144
  54. package/lib/typescript/src/index.d.ts.map +1 -1
  55. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts +210 -0
  56. package/lib/typescript/src/sdk/LiveVoiceSdk.d.ts.map +1 -0
  57. package/lib/typescript/src/sdk/LiveVoiceState.d.ts +12 -0
  58. package/lib/typescript/src/sdk/LiveVoiceState.d.ts.map +1 -0
  59. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts +3 -0
  60. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -1
  61. package/lib/typescript/src/util/Colors.d.ts.map +1 -1
  62. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts +7 -0
  63. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +1 -1
  64. package/lib/typescript/src/util/PlayingState.d.ts.map +1 -1
  65. package/lib/typescript/src/util/Translations.d.ts.map +1 -1
  66. package/lib/typescript/src/util/UIState.d.ts +22 -2
  67. package/lib/typescript/src/util/UIState.d.ts.map +1 -1
  68. package/lib/typescript/src/util/logger.d.ts +23 -0
  69. package/lib/typescript/src/util/logger.d.ts.map +1 -0
  70. package/livevoice-sdk-react-native.podspec +14 -14
  71. package/package.json +16 -7
  72. package/src/components/AudioOutputSwitchView.tsx +13 -13
  73. package/src/components/BrandingView.tsx +13 -11
  74. package/src/components/ChannelView.tsx +14 -11
  75. package/src/components/ErrorView.tsx +12 -10
  76. package/src/components/LiveVoiceView.tsx +183 -92
  77. package/src/components/PlayButtonView.tsx +12 -10
  78. package/src/components/ReconnectingView.tsx +20 -13
  79. package/src/components/WarningView.tsx +12 -10
  80. package/src/components/index.tsx +12 -10
  81. package/src/index.tsx +19 -252
  82. package/src/sdk/LiveVoiceSdk.ts +408 -0
  83. package/src/sdk/LiveVoiceState.ts +89 -0
  84. package/src/specs/NativeLiveVoiceSdk.ts +16 -10
  85. package/src/util/Colors.ts +12 -10
  86. package/src/util/ForegroundServiceConfig.tsx +21 -11
  87. package/src/util/PlayingState.ts +12 -10
  88. package/src/util/Translations.ts +12 -10
  89. package/src/util/UIState.ts +30 -13
  90. package/src/util/logger.ts +92 -0
  91. package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeLiveVoiceSdkSpec.java +0 -186
  92. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -28
  93. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec-generated.cpp +0 -235
  94. package/android/app/build/generated/source/codegen/jni/RNLiveVoiceSpec.h +0 -31
  95. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -341
  96. package/android/src/main/java/io/livevoice/react/Mappings.kt +0 -85
  97. package/android/src/main/java/io/livevoice/react/NativeModels.kt +0 -79
@@ -0,0 +1,210 @@
1
+ import { type UiState, type AvailableSubtitle, type SubtitleState } from '../util/UIState';
2
+ import { type ForegroundServiceConfig } from '../util/ForegroundServiceConfig';
3
+ import { type Claims } from './LiveVoiceState';
4
+ export type { Claims } from './LiveVoiceState';
5
+ /**
6
+ * The authorization features for the joined event. Both flags are `false` until an event is joined
7
+ * and ready.
8
+ */
9
+ export type Features = {
10
+ customUiAllowed: boolean;
11
+ hideBranding: boolean;
12
+ };
13
+ /**
14
+ * Initialize the LiveVoice SDK.
15
+ *
16
+ * @param {ForegroundServiceConfig} [androidServiceConfig=serviceDisabled] - Pass the service config on Android.
17
+ */
18
+ export declare function initialize(androidServiceConfig?: ForegroundServiceConfig): void;
19
+ /**
20
+ * Join an event.
21
+ *
22
+ * @abstract By joining an event you can display the event's channels.
23
+ *
24
+ * @param {string} joinCode - The listener code of your event. You can find it on the event page of the admin web-interface by clicking on 'Share with your audience'.
25
+ * @param {string | null} password - The optional password to join the event. If a password has been set for listeners in your event, it can be found in the 'Access' tab of the event page of the admin web-interface.
26
+ * @param {string} apiKey - Your API key. You can find your API key in the account page when logged in on the website.
27
+ */
28
+ export declare function joinEvent(joinCode: string, password: string | null, apiKey: string): void;
29
+ /**
30
+ * Leave the current event.
31
+ *
32
+ * @abstract You can explicitly leave an event to tear down any network connections the SDK uses when you no longer display any channels.
33
+ */
34
+ export declare function leaveEvent(): void;
35
+ /**
36
+ * Reconnect when a connection error occurred.
37
+ *
38
+ * @abstract Call this method to try to reconnect when a connection error has occurred.
39
+ */
40
+ export declare function reconnect(): void;
41
+ /**
42
+ * Get the claims for the current event.
43
+ *
44
+ * @deprecated Use {@link getCurrentFeatures} / {@link onFeaturesChanged} to read the authorization
45
+ * features, or build your UI with the `renderChannel` prop on `LiveVoiceView` (which applies the
46
+ * customization gating for you). Scheduled for removal in a future major version.
47
+ * @returns {Claims | null} The authorization claims, or `null` if not yet joined
48
+ */
49
+ export declare function getCurrentClaims(): Claims | null;
50
+ /**
51
+ * Get the authorization features for the joined event.
52
+ *
53
+ * @abstract Reflects what the joined API key permits. Both flags are `false` until an event is
54
+ * joined and ready. You should only need this for an initial value; use {@link onFeaturesChanged}
55
+ * to observe changes.
56
+ * @returns {Features} The current features (`customUiAllowed` / `hideBranding`).
57
+ */
58
+ export declare function getCurrentFeatures(): Features;
59
+ /**
60
+ * Get the current state of the LiveVoice SDK.
61
+ *
62
+ * @deprecated Build your UI with the `renderChannel` prop on `LiveVoiceView` instead of reading the
63
+ * raw UI state. Scheduled for removal in a future major version.
64
+ * @returns {UiState} The current view state
65
+ */
66
+ export declare function getCurrentUiState(): UiState;
67
+ /**
68
+ * Get the current available subtitle configurations.
69
+ *
70
+ * @abstract Returns `null` until the SDK has joined an event and reached the `ready` state, so you
71
+ * can tell "not loaded yet" (`null`) apart from "loaded, but none available" (`[]`). You should
72
+ * only need this for an initial value; use {@link onAvailableSubtitleConfigsChanged} to observe
73
+ * changes.
74
+ * @returns {AvailableSubtitle[] | null} The available subtitles, or `null` if not yet loaded.
75
+ */
76
+ export declare function getCurrentSubtitleConfiguration(): AvailableSubtitle[] | null;
77
+ /**
78
+ * Get the current subtitle fragments.
79
+ *
80
+ * @deprecated Use {@link getCurrentSubtitleState}, which returns the full subtitle state (type +
81
+ * channel + fragments). Scheduled for removal in a future major version.
82
+ * @returns {string[]} The current subtitle fragments
83
+ */
84
+ export declare function getCurrentSubtitles(): string[];
85
+ /**
86
+ * Get the current subtitle state.
87
+ *
88
+ * @abstract Unlike {@link getCurrentSubtitles} (fragments only), this returns the full state: the
89
+ * {@link SubtitleState.type} (`disabled`/`automatic`/`specific`), the channel for `specific`, and
90
+ * the fragments. You should only need to call this for an initial value; use
91
+ * {@link onSubtitleStateChanged} to observe changes.
92
+ * @returns {SubtitleState} The current subtitle state
93
+ */
94
+ export declare function getCurrentSubtitleState(): SubtitleState;
95
+ /**
96
+ * Get the current state of the audio output.
97
+ *
98
+ * @abstract You should only need to call this method to get an initial value. Use {@link onAudioOutputChanged}
99
+ ` to be updated about the audio state.
100
+ * @returns {boolean} `true` for the speaker and `false` for the receiver.
101
+ */
102
+ export declare function getCurrentAudioState(): boolean;
103
+ /**
104
+ * Set the audio output.
105
+ * @param {boolean} value - Set to `true` to use the speaker, and `false` to use the receiver.
106
+ */
107
+ export declare function setLiveVoiceUseSpeaker(value: boolean): void;
108
+ /**
109
+ * Start playing a channel.
110
+ * @abstract You can find the channel ID for a channel in the admin web-interface at the bottom when tapping *Edit Channel*.
111
+ * @deprecated Manual audio playback control should only be driven through `LiveVoiceView` channel
112
+ * cells. Use the `onAudioPress` helper passed to `renderChannel` instead. Scheduled for removal in
113
+ * a future major version.
114
+ * @param {number} [id] - The channel ID.
115
+ */
116
+ export declare function startChannel(id: number): void;
117
+ /**
118
+ * Stop playing the currently playing channel.
119
+ *
120
+ * @deprecated Manual audio playback control should only be driven through `LiveVoiceView` channel
121
+ * cells. Use the `onAudioPress` helper passed to `renderChannel` instead. Scheduled for removal in
122
+ * a future major version.
123
+ */
124
+ export declare function stopChannel(): void;
125
+ /**
126
+ * Start receiving subtitles.
127
+ * @abstract The SDK can receive a single stream of subtitle fragments at a time.
128
+ * You can stop receiving subtitles using {@link stopSubtitles()}.
129
+ * Whenever you call this method, any previous subtitle streams are stopped automatically and you receive the subtitles for the requested channel and language instead.
130
+ *
131
+ * Note: You have to make sure that subtitles for the given channel and language are enabled in the web-interface. You can use the {@link onAvailableSubtitleConfigsChanged} handler to check if subtitles are available for a given channel in a given language.
132
+ *
133
+ * @param {number | null} channelId - The channel to receive subtitles for. Set to `null` to always receive subtitles for the currently playing channel.
134
+ */
135
+ export declare function startSubtitles(channelId: number | null): void;
136
+ /**
137
+ * Stop receiving subtitles.
138
+ */
139
+ export declare function stopSubtitles(): void;
140
+ /**
141
+ * Handle changes of the audio output.
142
+ *
143
+ * @returns {object} - An object with a `remove` method to unsubscribe from the event.
144
+ */
145
+ export declare function onAudioOutputChanged(handler: (useSpeaker: boolean) => void): {
146
+ remove: () => void;
147
+ };
148
+ /**
149
+ * Handle changes of the UI state.
150
+ *
151
+ * @deprecated Build your UI with the `renderChannel` prop on `LiveVoiceView` instead of observing
152
+ * the raw UI state. Scheduled for removal in a future major version.
153
+ * @returns {object} - An object with a `remove` method to unsubscribe from the event.
154
+ */
155
+ export declare function onUiStateChanged(handler: (arg: UiState) => void): {
156
+ remove: () => void;
157
+ };
158
+ /**
159
+ * Handle changes of the authorization features.
160
+ *
161
+ * @abstract Re-emits whenever the joined session changes (join/leave/ready), so the
162
+ * `customUiAllowed` / `hideBranding` flags stay in sync with the current API key. Both are `false`
163
+ * while not joined.
164
+ * @returns {object} - An object with a `remove` method to unsubscribe from the event.
165
+ */
166
+ export declare function onFeaturesChanged(handler: (features: Features) => void): {
167
+ remove: () => void;
168
+ };
169
+ /**
170
+ * Handle changes of the available subtitle configurations.
171
+ *
172
+ * @abstract Reports `null` until the SDK reaches the `ready` state (see
173
+ * {@link getCurrentSubtitleConfiguration}), then the loaded array (`[]` when none are available).
174
+ * Re-emits when the configs change while ready, and when the ready state itself changes.
175
+ * @returns { object } - An object with a`remove` method to unsubscribe from the event.
176
+ */
177
+ export declare function onAvailableSubtitleConfigsChanged(handler: (arg: AvailableSubtitle[] | null) => void): {
178
+ remove: () => void;
179
+ };
180
+ /**
181
+ * Handle changes of the subtitle fragments.
182
+ *
183
+ * @deprecated Use {@link onSubtitleStateChanged}, which reports the full subtitle state (type +
184
+ * channel + fragments). Scheduled for removal in a future major version.
185
+ * @returns {object} - An object with a `remove` method to unsubscribe from the event.
186
+ */
187
+ export declare function onSubtitlesChanged(handler: (arg: string[]) => void): {
188
+ remove: () => void;
189
+ };
190
+ /**
191
+ * Handle changes of the subtitle state.
192
+ *
193
+ * @abstract Reports the full state (type + channel + fragments), unlike the fragments-only
194
+ * {@link onSubtitlesChanged}.
195
+ * @returns {object} - An object with a `remove` method to unsubscribe from the event.
196
+ */
197
+ export declare function onSubtitleStateChanged(handler: (state: SubtitleState) => void): {
198
+ remove: () => void;
199
+ };
200
+ /**
201
+ * Open the LiveVoice website in the device's default browser.
202
+ */
203
+ export declare function openLiveVoiceWebsite(): void;
204
+ /**
205
+ * Get the version of the LiveVoice React Native SDK.
206
+ *
207
+ * @returns {string} The SDK version, e.g. `"2.0.1"`.
208
+ */
209
+ export declare function getSdkVersion(): string;
210
+ //# sourceMappingURL=LiveVoiceSdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveVoiceSdk.d.ts","sourceRoot":"","sources":["../../../../src/sdk/LiveVoiceSdk.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EACL,KAAK,uBAAuB,EAG7B,MAAM,iCAAiC,CAAC;AAOzC,OAAO,EACL,KAAK,MAAM,EAIZ,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG;IAAE,eAAe,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,oBAAoB,GAAE,uBAAyC,GAC9D,IAAI,CAqBN;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,EAAE,MAAM,GACb,IAAI,CAMN;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAGjC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAGhC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAEhD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,QAAQ,CAM7C;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,I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CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,GAAG;IACpE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAKA;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GACtC;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAIxB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
@@ -0,0 +1,12 @@
1
+ import { type UiState } from '../util/UIState';
2
+ /** Authorization features for the joined event. Internal: the view uses it for branding/gating. */
3
+ export type Claims = {
4
+ hideBranding: boolean;
5
+ customUiAllowed: boolean;
6
+ };
7
+ export declare function getCurrentClaims(): Claims | null;
8
+ export declare function getCurrentUiState(): UiState;
9
+ export declare function onUiStateChanged(handler: (arg: UiState) => void): {
10
+ remove: () => void;
11
+ };
12
+ //# sourceMappingURL=LiveVoiceState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveVoiceState.d.ts","sourceRoot":"","sources":["../../../../src/sdk/LiveVoiceState.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,iBAAiB,CAAC;AAG7D,mGAAmG;AACnG,MAAM,MAAM,MAAM,GAAG;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAAC;AAoBzE,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAIhD;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,GAAG;IACjE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAMA"}
@@ -9,6 +9,7 @@ export interface Spec extends TurboModule {
9
9
  getCurrentUiState(): string;
10
10
  getCurrentAudioState(): boolean;
11
11
  getCurrentSubtitles(): string;
12
+ getCurrentSubtitleState(): string;
12
13
  getCurrentAvailableSubtitleConfigs(): string;
13
14
  setLiveVoiceUseSpeaker(value: boolean): void;
14
15
  startChannel(id: number): void;
@@ -19,10 +20,12 @@ export interface Spec extends TurboModule {
19
20
  startSubtitles(channelId: number): void;
20
21
  stopSubtitles(): void;
21
22
  openLiveVoiceWebsite(): void;
23
+ getSdkVersion(): string;
22
24
  readonly onUiStateChanged: EventEmitter<string>;
23
25
  readonly onAudioOutputChanged: EventEmitter<boolean>;
24
26
  readonly onAvailableSubtitleConfigsChanged: EventEmitter<string>;
25
27
  readonly onSubtitlesChanged: EventEmitter<string>;
28
+ readonly onSubtitleStateChanged: EventEmitter<string>;
26
29
  channelStatusOffline(): string;
27
30
  noChannels(): string;
28
31
  isAiChannelStatusMessage(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"NativeLiveVoiceSdk.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeLiveVoiceSdk.ts"],"names":[],"mappings":"AAWA,OAAO,EAAuB,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAIxF,KAAK,YAAY,CAAC,CAAC,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAEpD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,UAAU,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IACrD,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3E,UAAU,IAAI,IAAI,CAAC;IACnB,SAAS,IAAI,IAAI,CAAC;IAElB,gBAAgB,IAAI,MAAM,GAAC,IAAI,CAAC;IAGhC,iBAAiB,IAAI,MAAM,CAAC;IAC5B,oBAAoB,IAAI,OAAO,CAAC;IAChC,m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AC,CAAA;IACpD,QAAQ,CAAC,iCAAiC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAChE,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IACjD,QAAQ,CAAC,sBAAsB,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAIrD,oBAAoB,IAAI,MAAM,CAAA;IAC9B,UAAU,IAAI,MAAM,CAAA;IACpB,wBAAwB,IAAI,MAAM,CAAA;IAClC,qBAAqB,IAAI,MAAM,CAAA;IAE/B,mBAAmB,IAAI,MAAM,CAAA;IAC7B,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;IAE9C,eAAe,IAAI,MAAM,CAAA;IACzB,gBAAgB,IAAI,MAAM,CAAA;IAC1B,qBAAqB,IAAI,MAAM,CAAA;IAC/B,4BAA4B,IAAI,MAAM,CAAA;IACtC,iBAAiB,IAAI,MAAM,CAAA;IAC3B,gBAAgB,IAAI,MAAM,CAAA;IAC1B,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;IAChD,qBAAqB,IAAI,MAAM,CAAA;IAC/B,gBAAgB,IAAI,MAAM,CAAA;IAC1B,mBAAmB,IAAI,MAAM,CAAA;IAE7B,wBAAwB,IAAI,MAAM,CAAA;IAClC,+BAA+B,IAAI,MAAM,CAAA;IACzC,wBAAwB,IAAI,MAAM,CAAA;CACnC;;AAED,wBAAyE"}
@@ -1 +1 @@
1
- {"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../../src/util/Colors.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,MAAM;;;;;;;;;;;;CAiBlB,CAAC"}
1
+ {"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../../src/util/Colors.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,MAAM;;;;;;;;;;;;CAiBlB,CAAC"}
@@ -6,6 +6,13 @@ export interface Enabled {
6
6
  type: 'Enabled';
7
7
  message: string | null;
8
8
  }
9
+ /**
10
+ * Sentinel sent to the native module to request the SDK's built-in default notification
11
+ * message. The Android native module recognizes this exact string (see
12
+ * `DEFAULT_MESSAGE_SENTINEL` in `LiveVoiceModule.kt`) and substitutes the real default — the
13
+ * two must stay in sync. iOS ignores the foreground-service config entirely.
14
+ */
15
+ export declare const DEFAULT_MESSAGE_SENTINEL = "LV_NOTIFICATION_DEFAULT_MESSAGE";
9
16
  export declare const serviceDisabled: Disabled;
10
17
  export declare const serviceEnabledWithDefaultMessage: Enabled;
11
18
  export declare const serviceEnabledWithMessage: (message: string | null) => Enabled;
@@ -1 +1 @@
1
- {"version":3,"file":"ForegroundServiceConfig.d.ts","sourceRoot":"","sources":["../../../../src/util/ForegroundServiceConfig.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAGD,eAAO,MAAM,eAAe,EAAE,QAA+B,CAAC;AAE9D,eAAO,MAAM,gCAAgC,EAAE,OAAyE,CAAC;AAEzH,eAAO,MAAM,yBAAyB,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,OAGjE,CAAC"}
1
+ {"version":3,"file":"ForegroundServiceConfig.d.ts","sourceRoot":"","sources":["../../../../src/util/ForegroundServiceConfig.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,oCAAoC,CAAC;AAG1E,eAAO,MAAM,eAAe,EAAE,QAA+B,CAAC;AAE9D,eAAO,MAAM,gCAAgC,EAAE,OAAgE,CAAC;AAEhH,eAAO,MAAM,yBAAyB,GAAI,SAAS,MAAM,GAAG,IAAI,KAAG,OAGjE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PlayingState.d.ts","sourceRoot":"","sources":["../../../../src/util/PlayingState.ts"],"names":[],"mappings":"AAWA,oBAAY,YAAY;IACpB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACtB;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"PlayingState.d.ts","sourceRoot":"","sources":["../../../../src/util/PlayingState.ts"],"names":[],"mappings":"AAaA,oBAAY,YAAY;IACpB,OAAO,YAAY;IACnB,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACtB;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Translations.d.ts","sourceRoot":"","sources":["../../../../src/util/Translations.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,YAAY;gCACG,MAAM;sBAChB,MAAM;oCACQ,MAAM;iCACT,MAAM;+BACR,MAAM;qCACE,MAAM,KAAG,MAAM;2BAC3B,MAAM;4BACL,MAAM;iCACD,MAAM;wCACC,MAAM;6BACjB,MAAM;4BACP,MAAM;uCACO,MAAM,KAAG,MAAM;iCACvB,MAAM;+BACR,MAAM;4BACT,MAAM;oCACE,MAAM;2CACC,MAAM;oCACb,MAAM;CACrC,CAAC"}
1
+ {"version":3,"file":"Translations.d.ts","sourceRoot":"","sources":["../../../../src/util/Translations.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,YAAY;gCACG,MAAM;sBAChB,MAAM;oCACQ,MAAM;iCACT,MAAM;+BACR,MAAM;qCACE,MAAM,KAAG,MAAM;2BAC3B,MAAM;4BACL,MAAM;iCACD,MAAM;wCACC,MAAM;6BACjB,MAAM;4BACP,MAAM;uCACO,MAAM,KAAG,MAAM;iCACvB,MAAM;+BACR,MAAM;4BACT,MAAM;oCACE,MAAM;2CACC,MAAM;oCACb,MAAM;CACrC,CAAC"}
@@ -6,7 +6,6 @@ export type UiState = Ready | ErrorState | Loading | Reconnecting;
6
6
  export interface Ready {
7
7
  type: 'ready';
8
8
  channels: Channel[];
9
- isHeadphonesOnly: boolean;
10
9
  outputMode: string;
11
10
  }
12
11
  export interface Loading {
@@ -22,6 +21,10 @@ export interface RetryInProgress {
22
21
  }
23
22
  export interface AwaitingRetry {
24
23
  type: 'awaitingRetry';
24
+ retryAt: Date;
25
+ /**
26
+ * @deprecated Use retryAt instead. This is a Unix timestamp in seconds.
27
+ */
25
28
  atTimestamp: number;
26
29
  }
27
30
  export type RetryState = RetryInProgress | AwaitingRetry;
@@ -42,7 +45,7 @@ export interface Channel {
42
45
  hasSubtitles: boolean;
43
46
  isAudioMuted: boolean;
44
47
  aiTranslationInfo: AITranslationInfo | null;
45
- dependenChannels: [DependentChannel];
48
+ dependentChannels: DependentChannel[];
46
49
  playingState: PlayingState;
47
50
  }
48
51
  export interface AITranslationInfo {
@@ -63,4 +66,21 @@ export interface AvailableSubtitle {
63
66
  language: string | null;
64
67
  parent: number | null;
65
68
  }
69
+ /**
70
+ * The current subtitle state.
71
+ *
72
+ * - `disabled`: no subtitles are being received.
73
+ * - `automatic`: subtitles follow the currently playing channel.
74
+ * - `specific`: subtitles for an explicitly chosen channel.
75
+ */
76
+ export type SubtitleState = {
77
+ type: 'disabled';
78
+ } | {
79
+ type: 'automatic';
80
+ fragments: string[];
81
+ } | {
82
+ type: 'specific';
83
+ channelId: number;
84
+ fragments: string[];
85
+ };
66
86
  //# sourceMappingURL=UIState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UIState.d.ts","sourceRoot":"","sources":["../../../../src/util/UIState.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,K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AAE,MAAM,EAAE,CAAA;CAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type ForegroundServiceConfig } from "./ForegroundServiceConfig";
2
+ import { type UiState } from "./UIState";
3
+ type LogFields = Record<string, string | number | boolean | null | undefined>;
4
+ export declare const LiveVoiceLogEvent: {
5
+ readonly init: "LV_INIT";
6
+ readonly joinRequest: "LV_JOIN_REQUEST";
7
+ readonly leave: "LV_LEAVE";
8
+ readonly reconnectRequest: "LV_RECONNECT_REQUEST";
9
+ readonly uiState: "LV_UI_STATE";
10
+ readonly audioOutputSet: "LV_AUDIO_OUTPUT_SET";
11
+ readonly audioOutputChanged: "LV_AUDIO_OUTPUT_CHANGED";
12
+ readonly channelStart: "LV_CHANNEL_START";
13
+ readonly channelStop: "LV_CHANNEL_STOP";
14
+ readonly subtitlesStart: "LV_SUBTITLES_START";
15
+ readonly subtitlesStop: "LV_SUBTITLES_STOP";
16
+ readonly openWebsite: "LV_OPEN_WEBSITE";
17
+ };
18
+ export declare function logInfo(event: string, fields?: LogFields): void;
19
+ export declare function logUiState(state: UiState): void;
20
+ export declare function logAudioOutputChanged(useSpeaker: boolean): void;
21
+ export declare function describeForegroundServiceConfig(serviceConfig: ForegroundServiceConfig): string;
22
+ export {};
23
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../src/util/logger.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,KAAK,OAAO,EAAmB,MAAM,WAAW,CAAC;AAE1D,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAE9E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;CAapB,CAAC;AAEX,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAE/D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE/C;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAI/D;AAED,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,uBAAuB,GACrC,MAAM,CAGR"}
@@ -1,15 +1,15 @@
1
- # ===----------------------------------------------------------------------===//
2
- #
3
- # This source file is part of the LiveVoice SDK project
4
- #
5
- # Copyright (c) LiveVoice GmbH
6
- # Licensed under the MIT license
7
- #
8
- # See LICENSE for license information
9
- #
10
- # SPDX-License-Identifier: MIT
11
- #
12
- # ===----------------------------------------------------------------------===//
1
+ #===----------------------------------------------------------------------===#
2
+ #
3
+ # This source file is part of the LiveVoice SDK project
4
+ #
5
+ # Copyright (c) LiveVoice GmbH
6
+ # Licensed under the MIT license
7
+ #
8
+ # See LICENSE for license information
9
+ #
10
+ # SPDX-License-Identifier: MIT
11
+ #
12
+ #===----------------------------------------------------------------------===#
13
13
 
14
14
  require "json"
15
15
 
@@ -29,8 +29,8 @@ Pod::Spec.new do |s|
29
29
  s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
30
30
  s.exclude_files = "ios/generated/**/*"
31
31
 
32
- # The native LiveVoice SDK
33
- s.dependency "LiveVoiceSDK", '~> 2.0.0'
32
+ # The native LiveVoice SDK.
33
+ s.dependency "LiveVoiceSDK", '2.0.2'
34
34
 
35
35
 
36
36
  install_modules_dependencies(s)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "livevoice-sdk-react-native",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "The LiveVoice SDK for integrating simultaneous interpretation, AI voice translation, guided tours, silent events, and more into your app.",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -37,9 +37,19 @@
37
37
  "example": "yarn workspace livevoice-sdk-react-native-example",
38
38
  "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
39
39
  "prepare": "bob build",
40
+ "test": "jest --runInBand",
40
41
  "typecheck": "tsc",
41
- "native-version-generate": "node generate-native-versions.js",
42
- "clear-all": "sh clear-all.sh"
42
+ "check:headers": "node tool/license-headers.mjs --check",
43
+ "fix:headers": "node tool/license-headers.mjs --fix",
44
+ "check:pins": "node tool/check-native-pins.mjs",
45
+ "headers:check": "node tool/license-headers.mjs --check",
46
+ "headers:fix": "node tool/license-headers.mjs --fix",
47
+ "native-version-generate": "node tool/generate-native-versions.mjs",
48
+ "versions:sync": "node tool/generate-native-versions.mjs",
49
+ "matrix:list": "node tool/test-rn-version.mjs --list-versions-json",
50
+ "matrix:test": "node tool/test-rn-version.mjs",
51
+ "clear-all": "node tool/clean-all.mjs",
52
+ "clean:all": "node tool/clean-all.mjs"
43
53
  },
44
54
  "keywords": [
45
55
  "react-native",
@@ -51,10 +61,6 @@
51
61
  "silent events",
52
62
  "realtime audio"
53
63
  ],
54
- "repository": {
55
- "type": "git",
56
- "url": "git+https://livevoice.iolivevoice.io.git"
57
- },
58
64
  "author": "LiveVoice GmbH <sdk-support@livevoice.io> (https://livevoice.io)",
59
65
  "license": "MIT",
60
66
  "bugs": {
@@ -67,11 +73,14 @@
67
73
  "devDependencies": {
68
74
  "@react-native-community/cli": "latest",
69
75
  "@react-native/babel-preset": "0.85.0",
76
+ "@react-native/jest-preset": "0.85.0",
70
77
  "@types/react": "^19.2.0",
71
78
  "del-cli": "^7.0.0",
79
+ "jest": "^29.7.0",
72
80
  "react": "19.2.3",
73
81
  "react-native": "0.85.0",
74
82
  "react-native-builder-bob": "^0.41.0",
83
+ "react-test-renderer": "19.2.3",
75
84
  "turbo": "^2.8.21",
76
85
  "typescript": "^6.0.2"
77
86
  },
@@ -1,15 +1,17 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the LiveVoice SDK project
4
+ //
5
+ // Copyright (c) LiveVoice GmbH
6
+ // Licensed under the MIT license
7
+ //
8
+ // See LICENSE for license information
9
+ //
10
+ // SPDX-License-Identifier: MIT
11
+ //
12
+ //===----------------------------------------------------------------------===//
11
13
 
12
- import { getCurrentAudioState, onAudioOutputChanged, setLiveVoiceUseSpeaker } from 'livevoice-sdk-react-native';
14
+ import { getCurrentAudioState, onAudioOutputChanged, setLiveVoiceUseSpeaker } from '../sdk/LiveVoiceSdk';
13
15
  import React, { useState, useRef, useEffect, } from 'react';
14
16
  import {
15
17
  View,
@@ -29,7 +31,6 @@ export const AudioOutputSwitchView: React.FC<AudioOutputSwitchProps> = (props) =
29
31
  const [isSpeaker, setIsSpeaker] = useState<Boolean>((() => (getCurrentAudioState())))
30
32
  useEffect(() => {
31
33
  let subscription: { remove(): void } | undefined = onAudioOutputChanged((value: boolean) => {
32
- console.log('State changed: ' + value);
33
34
  setIsSpeaker(value);
34
35
  });
35
36
  return () => {
@@ -61,7 +62,6 @@ export const AudioOutputSwitchView: React.FC<AudioOutputSwitchProps> = (props) =
61
62
  <TouchableOpacity
62
63
  activeOpacity={1}
63
64
  onPress={() => {
64
- console.log('Clicked: with current' + isSpeaker);
65
65
  setLiveVoiceUseSpeaker(!isSpeaker);
66
66
  }}
67
67
  style={[
@@ -1,13 +1,15 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the LiveVoice SDK project
4
+ //
5
+ // Copyright (c) LiveVoice GmbH
6
+ // Licensed under the MIT license
7
+ //
8
+ // See LICENSE for license information
9
+ //
10
+ // SPDX-License-Identifier: MIT
11
+ //
12
+ //===----------------------------------------------------------------------===//
11
13
 
12
14
  import React from 'react';
13
15
  import {
@@ -20,7 +22,7 @@ import {
20
22
  } from 'react-native';
21
23
 
22
24
  import { COLORS } from '../util/Colors';
23
- import { openLiveVoiceWebsite } from 'livevoice-sdk-react-native';
25
+ import { openLiveVoiceWebsite } from '../sdk/LiveVoiceSdk';
24
26
 
25
27
  export interface BrandingProps {
26
28
  isDarkMode?: boolean;
@@ -1,13 +1,15 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the LiveVoice SDK project
4
+ //
5
+ // Copyright (c) LiveVoice GmbH
6
+ // Licensed under the MIT license
7
+ //
8
+ // See LICENSE for license information
9
+ //
10
+ // SPDX-License-Identifier: MIT
11
+ //
12
+ //===----------------------------------------------------------------------===//
11
13
 
12
14
  import React, { useState } from 'react';
13
15
  import { View, Text, StyleSheet, TouchableOpacity, useColorScheme, Image } from 'react-native';
@@ -78,7 +80,8 @@ const styles = StyleSheet.create({
78
80
  container: {
79
81
  flexDirection: 'row',
80
82
  alignItems: 'center',
81
- padding: 10,
83
+ paddingHorizontal: 12,
84
+ paddingVertical: 8,
82
85
  },
83
86
  text: {
84
87
  fontSize: 16,
@@ -1,13 +1,15 @@
1
- /*
2
- * This source file is part of the LiveVoice SDK project
3
- *
4
- * Copyright (c) LiveVoice GmbH
5
- * Licensed under the MIT license
6
- *
7
- * See LICENSE for license information
8
- *
9
- * SPDX-License-Identifier: MIT
10
- */
1
+ //===----------------------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the LiveVoice SDK project
4
+ //
5
+ // Copyright (c) LiveVoice GmbH
6
+ // Licensed under the MIT license
7
+ //
8
+ // See LICENSE for license information
9
+ //
10
+ // SPDX-License-Identifier: MIT
11
+ //
12
+ //===----------------------------------------------------------------------===//
11
13
 
12
14
  import React from 'react';
13
15
  import { View, Text, useColorScheme, StyleSheet, TouchableOpacity } from 'react-native';