agora-appbuilder-core 4.0.1 → 4.0.2

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.1",
3
+ "version": "4.0.2",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -24,6 +24,7 @@ export interface AppBuilderSdkApiInterface {
24
24
  joinPrecall: (
25
25
  roomDetails: string | meetingData,
26
26
  userName?: string,
27
+ skipPrecall?: boolean,
27
28
  ) => Promise<
28
29
  [
29
30
  meetingData,
@@ -70,13 +71,13 @@ export const AppBuilderSdkApi: AppBuilderSdkApiInterface = {
70
71
  userName,
71
72
  );
72
73
  },
73
- joinPrecall: async (roomDetails, userName) => {
74
+ joinPrecall: async (roomDetails, userName, skipPrecall) => {
74
75
  if (!$config.PRECALL)
75
76
  throw new Error('Precall disabled in config, cant join precall');
76
77
  const t = await SDKMethodEventsManager.emit(
77
78
  'join',
78
79
  roomDetails,
79
- false,
80
+ skipPrecall,
80
81
  userName,
81
82
  );
82
83
  return t as unknown as [
@@ -1,5 +1,6 @@
1
1
  import {useLocation} from '../components/Router';
2
2
  import {useMemo} from 'react';
3
+ import isSDK from './isSDK';
3
4
 
4
5
  interface ReadOnlyURLSearchParams extends URLSearchParams {
5
6
  append: never;
@@ -8,9 +9,18 @@ interface ReadOnlyURLSearchParams extends URLSearchParams {
8
9
  sort: never;
9
10
  }
10
11
 
11
- export function useSearchParams() {
12
- const {search} = useLocation();
12
+ function useLocationWrapper() {
13
+ let search = useLocation().search;
14
+ if (isSDK()) {
15
+ search = window.location.search;
16
+ }
17
+ return {
18
+ search,
19
+ };
20
+ }
13
21
 
22
+ export function useSearchParams() {
23
+ const {search} = useLocationWrapper();
14
24
  return useMemo(
15
25
  () => new URLSearchParams(search) as ReadOnlyURLSearchParams,
16
26
  [search],