agora-appbuilder-core 4.0.0-beta.79 → 4.0.0-beta.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.0.0-beta.79",
3
+ "version": "4.0.0-beta.80",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -174,27 +174,10 @@ interface RemoteStream {
174
174
  }
175
175
 
176
176
  if ($config.GEO_FENCING) {
177
- let includeArea = $config.GEO_FENCING_INCLUDE_AREA
178
- ? $config.GEO_FENCING_INCLUDE_AREA
179
- : AREAS.GLOBAL;
180
- let excludeArea = $config.GEO_FENCING_EXCLUDE_AREA
181
- ? $config.GEO_FENCING_EXCLUDE_AREA
182
- : '';
183
-
184
- try {
185
- if (excludeArea) {
186
- AgoraRTC.setArea({
187
- areaCode: includeArea,
188
- excludedArea: excludeArea,
189
- });
190
- } else {
191
- AgoraRTC.setArea({
192
- areaCode: includeArea,
193
- });
194
- }
195
- } catch (setAeraError) {
196
- console.log('error on setArea', setAeraError);
197
- }
177
+ AgoraRTC.setArea({
178
+ areaCode: AREAS.GLOBAL,
179
+ excludedArea: AREAS.CHINA,
180
+ });
198
181
  }
199
182
 
200
183
  if ($config.LOG_ENABLED) {
@@ -23,8 +23,6 @@ const DefaultConfig = {
23
23
  SLACK_CLIENT_ID: '',
24
24
  APPLE_CLIENT_ID: '',
25
25
  GEO_FENCING: true,
26
- GEO_FENCING_INCLUDE_AREA: 'GLOBAL',
27
- GEO_FENCING_EXCLUDE_AREA: '',
28
26
  LOG_ENABLED: true,
29
27
  EVENT_MODE: false,
30
28
  RAISE_HAND: false,
@@ -69,8 +69,6 @@ interface ConfigInterface {
69
69
  EVENT_MODE: boolean;
70
70
  RAISE_HAND: boolean;
71
71
  GEO_FENCING: boolean;
72
- GEO_FENCING_INCLUDE_AREA: string;
73
- GEO_FENCING_EXCLUDE_AREA: string;
74
72
  LOG_ENABLED: boolean;
75
73
  AUDIO_ROOM: boolean;
76
74
  PRIMARY_ACTION_BRAND_COLOR: string;
@@ -361,8 +361,6 @@ PODS:
361
361
  - React-Core
362
362
  - react-native-document-picker (9.1.1):
363
363
  - React-Core
364
- - react-native-document-picker (9.1.0):
365
- - React-Core
366
364
  - react-native-keep-awake (4.0.0):
367
365
  - React
368
366
  - react-native-webview (13.8.1):
@@ -530,7 +528,7 @@ PODS:
530
528
  - React-RCTText
531
529
  - ReactCommon/turbomodule/core
532
530
  - Yoga
533
- - RNShare (7.9.0):
531
+ - RNShare (10.0.2):
534
532
  - React-Core
535
533
  - RNSVG (13.6.0):
536
534
  - React-Core
@@ -764,8 +762,8 @@ SPEC CHECKSUMS:
764
762
  React-jsiexecutor: c7f826e40fa9cab5d37cab6130b1af237332b594
765
763
  React-jsinspector: aaed4cf551c4a1c98092436518c2d267b13a673f
766
764
  React-logger: da1ebe05ae06eb6db4b162202faeafac4b435e77
767
- react-native-agora: 16de7d9657b24dcf1ea6edebb30d06fe3e050c68
768
- react-native-document-picker: b4f4a23b73f864ce17965b284c0757648993805b
765
+ react-native-agora: 0d623411f75a126e6d5f6a41761df9ef74da87e6
766
+ react-native-document-picker: 3599b238843369026201d2ef466df53f77ae0452
769
767
  react-native-keep-awake: afad8a51dfef9fe9655a6344771be32c8596d774
770
768
  react-native-webview: bdc091de8cf7f8397653e30182efcd9f772e03b3
771
769
  react-native-whiteboard: d56d2ffa0392b8572bfc613954845e48c6dfd38e
@@ -796,7 +794,7 @@ SPEC CHECKSUMS:
796
794
  RNGestureHandler: 62232ba8f562f7dea5ba1b3383494eb5bf97a4d3
797
795
  RNInAppBrowser: 48b95ba7a4eaff5cc223bca338d3e319561dbd1b
798
796
  RNReanimated: 726395a2fa2f04cea340274ba57a4e659bc0d9c1
799
- RNShare: be91a5c149585affb02c25b351bd07ba927c7006
797
+ RNShare: 859ff710211285676b0bcedd156c12437ea1d564
800
798
  RNSVG: 3a79c0c4992213e4f06c08e62730c5e7b9e4dc17
801
799
  RNVectorIcons: fcc2f6cb32f5735b586e66d14103a74ce6ad61f8
802
800
  SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
@@ -804,4 +802,4 @@ SPEC CHECKSUMS:
804
802
 
805
803
  PODFILE CHECKSUM: be04179eb7bb6b413f3e785e287b050128ebfee6
806
804
 
807
- COCOAPODS: 1.12.1
805
+ COCOAPODS: 1.15.2
@@ -92,7 +92,7 @@
92
92
  "react-native-keyboard-manager": "6.5.4-1",
93
93
  "react-native-reanimated": "3.4.2",
94
94
  "react-native-responsive-fontsize": "0.5.1",
95
- "react-native-share": "7.9.0",
95
+ "react-native-share": "10.0.2",
96
96
  "react-native-svg": "13.6.0",
97
97
  "react-native-vector-icons": "9.2.0",
98
98
  "react-native-walkthrough-tooltip": "1.4.0",
@@ -45,7 +45,7 @@ type VBContextValue = {
45
45
  export const VBContext = React.createContext<VBContextValue>({
46
46
  isVBActive: false,
47
47
  setIsVBActive: () => {},
48
- vbMode: 'none',
48
+ vbMode: null,
49
49
  setVBmode: () => {},
50
50
  selectedImage: null,
51
51
  setSelectedImage: () => {},
@@ -72,7 +72,7 @@ const downloadBase64Image = async (base64Data, filename) => {
72
72
 
73
73
  const VBProvider: React.FC = ({children}) => {
74
74
  const [isVBActive, setIsVBActive] = React.useState<boolean>(false);
75
- const [vbMode, setVBmode] = React.useState<VBMode>('none');
75
+ const [vbMode, setVBmode] = React.useState<VBMode>(null);
76
76
  const [selectedImage, setSelectedImage] = React.useState<
77
77
  ImageSourcePropType | string | null
78
78
  >(null);
@@ -114,9 +114,9 @@ const VBProvider: React.FC = ({children}) => {
114
114
  disable = false,
115
115
  ) => {
116
116
  if (disable) {
117
- await rtc?.RtcEngineUnsafe.enableVirtualBackground(false, config);
117
+ await rtc?.RtcEngineUnsafe.enableVirtualBackground(false, config, {});
118
118
  } else {
119
- await rtc?.RtcEngineUnsafe.enableVirtualBackground(true, config);
119
+ await rtc?.RtcEngineUnsafe.enableVirtualBackground(true, config, {});
120
120
  }
121
121
  };
122
122
 
@@ -133,7 +133,7 @@ const VBProvider: React.FC = ({children}) => {
133
133
  disableVB();
134
134
  break;
135
135
  default:
136
- disableVB();
136
+ break;
137
137
  }
138
138
  }, [vbMode, selectedImage, saveVB, previewVideoTrack]);
139
139
 
@@ -156,7 +156,6 @@ const VBProvider: React.FC = ({children}) => {
156
156
  const disableConfig: VirtualBackgroundSource =
157
157
  new VirtualBackgroundSource();
158
158
  disableConfig.background_source_type = BackgroundSourceType.BackgroundNone;
159
-
160
159
  await applyVirtualBackgroundToMainView(disableConfig, true);
161
160
  };
162
161
 
@@ -80,37 +80,6 @@ import {useIsRecordingBot} from '../subComponents/recording/useIsRecordingBot';
80
80
  import {videoRoomStartingCallText} from '../language/default-labels/videoCallScreenLabels';
81
81
  import {useString} from '../utils/useString';
82
82
 
83
- const NativeAreaCode = {
84
- /**
85
- * China.
86
- */
87
- CHINA: 1,
88
- /**
89
- * Asia, excluding Mainland China.
90
- */
91
- ASIA: 8,
92
- /**
93
- * North America.
94
- */
95
- NORTH_AMERICA: 2,
96
- /**
97
- * Europe.
98
- */
99
- EUROPE: 4,
100
- /**
101
- * Japan.
102
- */
103
- JAPAN: 16,
104
- /**
105
- * India.
106
- */
107
- INDIA: 32,
108
- /**
109
- * Global.
110
- */
111
- GLOBAL: -1,
112
- };
113
-
114
83
  enum RnEncryptionEnum {
115
84
  /**
116
85
  * @deprecated
@@ -205,21 +174,6 @@ const VideoCall: React.FC = () => {
205
174
  clearState,
206
175
  } = useContext(SdkApiContext);
207
176
 
208
- let geoFencingIncludeArea = -1;
209
- let geoFencingExcludeArea = 0;
210
-
211
- try {
212
- geoFencingIncludeArea = NativeAreaCode[$config.GEO_FENCING_INCLUDE_AREA];
213
- } catch (error) {
214
- console.log('error on native geoFencingIncludeArea', error);
215
- }
216
-
217
- try {
218
- geoFencingExcludeArea = NativeAreaCode[$config.GEO_FENCING_EXCLUDE_AREA];
219
- } catch (error) {
220
- console.log('error on native geoFencingExcludeArea', error);
221
- }
222
-
223
177
  // commented for v1 release
224
178
  //const lifecycle = useCustomization((data) => data.lifecycle);
225
179
  const [rtcProps, setRtcProps] = React.useState({
@@ -237,8 +191,6 @@ const VideoCall: React.FC = () => {
237
191
  : false,
238
192
  role: ClientRoleType.ClientRoleBroadcaster,
239
193
  geoFencing: $config.GEO_FENCING,
240
- geoFencingIncludeArea: geoFencingIncludeArea,
241
- geoFencingExcludeArea: geoFencingExcludeArea,
242
194
  audioRoom: $config.AUDIO_ROOM,
243
195
  activeSpeaker: $config.ACTIVE_SPEAKER,
244
196
  preferredCameraId:
@@ -2,7 +2,6 @@
2
2
  // 1. RECORDING
3
3
  const RECORDING_STARTED = 'RECORDING_STARTED';
4
4
  const RECORDING_STOPPED = 'RECORDING_STOPPED';
5
- const RECORDING_STOP_REQUEST = 'RECORDING_STOP_REQUEST';
6
5
  // 2. SCREENSHARE
7
6
  const SCREENSHARE_STARTED = 'SCREENSHARE_STARTED';
8
7
  const SCREENSHARE_STOPPED = 'SCREENSHARE_STOPPED';
@@ -10,7 +9,6 @@ const SCREENSHARE_STOPPED = 'SCREENSHARE_STOPPED';
10
9
  const EventActions = {
11
10
  RECORDING_STARTED,
12
11
  RECORDING_STOPPED,
13
- RECORDING_STOP_REQUEST,
14
12
  SCREENSHARE_STARTED,
15
13
  SCREENSHARE_STOPPED,
16
14
  };
@@ -33,22 +33,17 @@ const useTranscriptDownload = (): {
33
33
  .writeFile(filePath, finalContent, 'utf8')
34
34
  .then(() => {
35
35
  console.warn('Content downloaded successfully on native.');
36
- // display preview of the document and option to share
37
- if (isIOS()) {
38
- RNFetchBlob.ios.previewDocument(filePath);
39
- } else if (isAndroid()) {
40
- console.warn('android download complete !');
41
- // need to show the preview of downloaded file
42
- Share.open({url: `file://${filePath}`, type: 'text/plain'})
43
- .then(res => {
44
- console.warn('File shared successfully:', res);
45
- resolve(filePath);
46
- })
47
- .catch(error => {
48
- console.error('Error sharing file:', error);
49
- reject(error);
50
- });
51
- }
36
+ // need to show the preview of downloaded file
37
+ Share.open({url: `file://${filePath}`, type: 'text/plain'})
38
+ .then(res => {
39
+ // console.warn('File shared successfully:', res);
40
+ resolve(filePath);
41
+ })
42
+ .catch(error => {
43
+ // console.error('Error sharing file:', error);
44
+ reject(error);
45
+ });
46
+
52
47
  resolve(filePath);
53
48
  })
54
49
  .catch(error => {
@@ -185,6 +185,11 @@ const RecordingProvider = (props: RecordingProviderProps) => {
185
185
  const startRecording = () => {
186
186
  const passphrase = roomId.host || '';
187
187
  console.log('web-recording - start recording API called');
188
+ if (inProgress) {
189
+ console.log('web-recording - start recording API already in progress');
190
+ return;
191
+ }
192
+ setInProgress(true);
188
193
  fetch(`${$config.BACKEND_ENDPOINT}/v1/recording/start`, {
189
194
  method: 'POST',
190
195
  headers: {
@@ -230,80 +235,61 @@ const RecordingProvider = (props: RecordingProviderProps) => {
230
235
 
231
236
  const stopRecording = useCallback(() => {
232
237
  /**
233
- * if condition added for below issue
234
- *
235
- * user 1 and user 2 in the call
236
- * user 1 start the recording
237
- * user 2 stops the recording
238
- * user 2 join the call getting stop recording notification which is not needed
239
- *
240
- * solution
241
- * case 1 - if recording is not started by the host then we will send level1 message to host who started the recording
242
- * case 2 - if person who started the recording no longer available in the call then will stop the recording
238
+ * Any host in the channel can stop recording.
243
239
  */
244
- if (
245
- localUid === uidWhoStarted ||
246
- activeUids.indexOf(uidWhoStarted) === -1
247
- ) {
248
- setInProgress(true);
249
- // If recording is already going on, stop the recording by executing the below query.
250
- console.log('web-recording - stop recording API called');
251
- fetch(`${$config.BACKEND_ENDPOINT}/v1/recording/stop`, {
252
- method: 'POST',
253
- headers: {
254
- 'Content-Type': 'application/json',
255
- authorization: store.token ? `Bearer ${store.token}` : '',
256
- },
257
- body: JSON.stringify({
258
- passphrase: roomId.host,
259
- }),
260
- })
261
- .then(res => {
262
- setInProgress(false);
263
- if (res.status === 200) {
264
- /**
265
- * 1. Once the backend sucessfuly starts recording, send message
266
- * in the channel indicating that cloud recording is now inactive.
267
- */
268
- events.send(
269
- EventNames.RECORDING_ATTRIBUTE,
270
- JSON.stringify({
271
- action: EventActions.RECORDING_STOPPED,
272
- value: '',
273
- }),
274
- PersistanceLevel.Session,
275
- );
276
- // 2. set the local recording state to false to update the UI
277
- setRecordingActive(false);
278
- } else if (res.status === 500) {
279
- showErrorToast(headingStopError, subheadingError);
280
- } else {
281
- showErrorToast(headingStopError);
282
- }
283
- })
284
- .catch(err => {
285
- setInProgress(false);
286
- console.log(err);
287
- });
288
- } else {
289
- events.send(
290
- EventNames.RECORDING_ATTRIBUTE,
291
- JSON.stringify({
292
- action: EventActions.RECORDING_STOP_REQUEST,
293
- value: '',
294
- }),
295
- PersistanceLevel.None,
240
+ console.log('web-recording - stop recording API called');
241
+ if (inProgress) {
242
+ console.log(
243
+ 'web-recording - stop recording already in progress. Aborting..',
296
244
  );
245
+ return;
297
246
  }
247
+ setInProgress(true);
248
+ // If recording is already going on, stop the recording by executing the below query.
249
+ fetch(`${$config.BACKEND_ENDPOINT}/v1/recording/stop`, {
250
+ method: 'POST',
251
+ headers: {
252
+ 'Content-Type': 'application/json',
253
+ authorization: store.token ? `Bearer ${store.token}` : '',
254
+ },
255
+ body: JSON.stringify({
256
+ passphrase: roomId.host,
257
+ }),
258
+ })
259
+ .then(res => {
260
+ setInProgress(false);
261
+ if (res.status === 200) {
262
+ /**
263
+ * 1. Once the backend sucessfuly stops recording, send message
264
+ * in the channel indicating that cloud recording is now inactive.
265
+ */
266
+ events.send(
267
+ EventNames.RECORDING_ATTRIBUTE,
268
+ JSON.stringify({
269
+ action: EventActions.RECORDING_STOPPED,
270
+ value: '',
271
+ }),
272
+ PersistanceLevel.Session,
273
+ );
274
+ // 2. set the local recording state to false to update the UI
275
+ setRecordingActive(false);
276
+ } else if (res.status === 500) {
277
+ showErrorToast(headingStopError, subheadingError);
278
+ } else {
279
+ showErrorToast(headingStopError);
280
+ }
281
+ })
282
+ .catch(err => {
283
+ setInProgress(false);
284
+ console.log(err);
285
+ });
298
286
  }, [
299
- activeUids,
300
287
  headingStopError,
301
- localUid,
288
+ inProgress,
302
289
  roomId.host,
303
290
  setRecordingActive,
304
291
  store.token,
305
292
  subheadingError,
306
- uidWhoStarted,
307
293
  ]);
308
294
 
309
295
  React.useEffect(() => {
@@ -319,9 +305,6 @@ const RecordingProvider = (props: RecordingProviderProps) => {
319
305
  case EventActions.RECORDING_STOPPED:
320
306
  setRecordingActive(false);
321
307
  break;
322
- case EventActions.RECORDING_STOP_REQUEST:
323
- stopRecording();
324
- break;
325
308
  default:
326
309
  break;
327
310
  }
@@ -329,7 +312,7 @@ const RecordingProvider = (props: RecordingProviderProps) => {
329
312
  return () => {
330
313
  events.off(EventNames.RECORDING_ATTRIBUTE);
331
314
  };
332
- }, [roomId.host, setRecordingActive, stopRecording]);
315
+ }, [roomId.host, setRecordingActive]);
333
316
 
334
317
  return (
335
318
  <RecordingContext.Provider