agora-appbuilder-core 4.0.0-ms.9 → 4.0.0-spl.5
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 +1 -1
- package/template/Gulpfile.js +7 -7
- package/template/_package-lock.json +0 -22
- package/template/bridge/rtc/webNg/RtcEngine.ts +1 -1
- package/template/customization-api/typeDefinition.ts +2 -1
- package/template/global.d.ts +0 -3
- package/template/index.wsdk.tsx +1 -19
- package/template/package.json +0 -2
- package/template/src/App.tsx +76 -3
- package/template/src/AppWrapper.tsx +13 -16
- package/template/src/SDKAppWrapper.tsx +46 -49
- package/template/src/atoms/Popup.tsx +1 -3
- package/template/src/components/Chat.tsx +9 -8
- package/template/src/components/DeviceConfigure.tsx +276 -122
- package/template/src/components/GraphQLProvider.tsx +35 -60
- package/template/src/components/Navigation.native.tsx +15 -1
- package/template/src/components/Navigation.tsx +15 -1
- package/template/src/components/OAuth.electron.tsx +41 -0
- package/template/src/components/OAuth.native.tsx +55 -0
- package/template/src/components/{Navigation.sdk.tsx → OAuth.tsx} +16 -18
- package/template/src/components/OAuthConfig.ts +77 -0
- package/template/src/components/Precall.native.tsx +2 -24
- package/template/src/components/Precall.tsx +13 -28
- package/template/src/components/RTMConfigure.tsx +3 -0
- package/template/src/components/Router.electron.ts +0 -1
- package/template/src/components/Router.native.ts +0 -1
- package/template/src/components/Router.sdk.ts +0 -1
- package/template/src/components/Router.ts +0 -1
- package/template/src/components/SdkApiContext.tsx +141 -14
- package/template/src/components/SdkMuteToggleListener.tsx +92 -0
- package/template/src/components/SettingsView.tsx +1 -3
- package/template/src/components/Share.tsx +2 -22
- package/template/src/components/StorageContext.tsx +4 -20
- package/template/src/components/StoreToken.tsx +39 -0
- package/template/src/components/popups/InvitePopup.tsx +2 -6
- package/template/src/components/precall/joinCallBtn.native.tsx +1 -3
- package/template/src/components/precall/joinCallBtn.tsx +0 -4
- package/template/src/components/useShareLink.tsx +5 -8
- package/template/src/components/useUserPreference.tsx +0 -29
- package/template/src/pages/Create.tsx +1 -21
- package/template/src/pages/Join.tsx +1 -21
- package/template/src/pages/VideoCall.tsx +28 -28
- package/template/src/subComponents/LocalEndCall.tsx +0 -1
- package/template/src/subComponents/LogoutButton.tsx +1 -1
- package/template/src/subComponents/recording/useRecording.tsx +2 -14
- package/template/src/utils/SdkEvents.ts +10 -4
- package/template/src/utils/SdkMethodEvents.ts +18 -1
- package/template/src/utils/common.tsx +5 -22
- package/template/src/utils/useCreateMeeting.ts +11 -2
- package/template/src/utils/useJoinMeeting.ts +0 -4
- package/template/src/utils/useMuteToggleLocal.ts +96 -52
- package/template/tsconfig_rsdk_index.json +3 -3
- package/template/tsconfig_wsdk_index.json +1 -1
- package/template/webpack.web.config.js +3 -7
- package/template/src/AppRoutes.tsx +0 -45
- package/template/src/auth/AuthProvider.tsx +0 -470
- package/template/src/auth/AuthRoute.tsx +0 -86
- package/template/src/auth/IDPAuth.electron.tsx +0 -30
- package/template/src/auth/IDPAuth.tsx +0 -64
- package/template/src/auth/IDPLogoutComponent.tsx +0 -149
- package/template/src/auth/UserCancelPopup.tsx +0 -108
- package/template/src/auth/config.ts +0 -52
- package/template/src/auth/openIDPURL.electron.tsx +0 -38
- package/template/src/auth/openIDPURL.native.tsx +0 -51
- package/template/src/auth/openIDPURL.tsx +0 -20
- package/template/src/auth/useIDPAuth.electron.tsx +0 -62
- package/template/src/auth/useIDPAuth.native.tsx +0 -70
- package/template/src/auth/useIDPAuth.tsx +0 -59
- package/template/src/auth/useTokenAuth.tsx +0 -190
- package/template/src/pages/Login.tsx +0 -26
- package/template/src/subComponents/Loading.tsx +0 -47
package/package.json
CHANGED
package/template/Gulpfile.js
CHANGED
|
@@ -460,11 +460,11 @@ module.exports.androidWin = series(
|
|
|
460
460
|
);
|
|
461
461
|
|
|
462
462
|
module.exports.test = series(
|
|
463
|
-
general.
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
463
|
+
general.createBuildDirectory,
|
|
464
|
+
general.generateApiTypedefs,
|
|
465
|
+
general.bundleApiTypedefs,
|
|
466
|
+
webSdk.generateSdkTypedefs,
|
|
467
|
+
webSdk.bundleSdkTypedefs,
|
|
468
|
+
general.cleanTempFiles,
|
|
469
|
+
general.genTsDefs,
|
|
470
470
|
);
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"electron-updater": "4.3.9",
|
|
26
26
|
"exponential-backoff": "3.1.0",
|
|
27
27
|
"graphql": "15.5.0",
|
|
28
|
-
"jwt-decode": "3.1.2",
|
|
29
28
|
"nanoevents": "7.0.1",
|
|
30
29
|
"nanoid": "4.0.0",
|
|
31
30
|
"nosleep.js": "0.12.0",
|
|
@@ -34,7 +33,6 @@
|
|
|
34
33
|
"react-is": "18.0.0",
|
|
35
34
|
"react-native": "0.64",
|
|
36
35
|
"react-native-agora": "3.7.1",
|
|
37
|
-
"react-native-exit-app": "1.1.0",
|
|
38
36
|
"react-native-gesture-handler": "2.8.0",
|
|
39
37
|
"react-native-hyperlink": "0.0.19",
|
|
40
38
|
"react-native-inappbrowser-reborn": "3.5.1",
|
|
@@ -19421,11 +19419,6 @@
|
|
|
19421
19419
|
"integrity": "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==",
|
|
19422
19420
|
"dev": true
|
|
19423
19421
|
},
|
|
19424
|
-
"node_modules/jwt-decode": {
|
|
19425
|
-
"version": "3.1.2",
|
|
19426
|
-
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz",
|
|
19427
|
-
"integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A=="
|
|
19428
|
-
},
|
|
19429
19422
|
"node_modules/keyv": {
|
|
19430
19423
|
"version": "3.1.0",
|
|
19431
19424
|
"resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz",
|
|
@@ -23560,11 +23553,6 @@
|
|
|
23560
23553
|
"nullthrows": "^1.1.1"
|
|
23561
23554
|
}
|
|
23562
23555
|
},
|
|
23563
|
-
"node_modules/react-native-exit-app": {
|
|
23564
|
-
"version": "1.1.0",
|
|
23565
|
-
"resolved": "https://registry.npmjs.org/react-native-exit-app/-/react-native-exit-app-1.1.0.tgz",
|
|
23566
|
-
"integrity": "sha512-Spne19zfMfJvnUTX909EHUqWMk69rATtLJq9XMBGpNSHhx0M7v5yetx2Z87egBhLOqQm+CWfD/oxWzDG8rbIQA=="
|
|
23567
|
-
},
|
|
23568
23556
|
"node_modules/react-native-gesture-handler": {
|
|
23569
23557
|
"version": "2.8.0",
|
|
23570
23558
|
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.8.0.tgz",
|
|
@@ -44628,11 +44616,6 @@
|
|
|
44628
44616
|
"integrity": "sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==",
|
|
44629
44617
|
"dev": true
|
|
44630
44618
|
},
|
|
44631
|
-
"jwt-decode": {
|
|
44632
|
-
"version": "3.1.2",
|
|
44633
|
-
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz",
|
|
44634
|
-
"integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A=="
|
|
44635
|
-
},
|
|
44636
44619
|
"keyv": {
|
|
44637
44620
|
"version": "3.1.0",
|
|
44638
44621
|
"resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz",
|
|
@@ -48028,11 +48011,6 @@
|
|
|
48028
48011
|
"nullthrows": "^1.1.1"
|
|
48029
48012
|
}
|
|
48030
48013
|
},
|
|
48031
|
-
"react-native-exit-app": {
|
|
48032
|
-
"version": "1.1.0",
|
|
48033
|
-
"resolved": "https://registry.npmjs.org/react-native-exit-app/-/react-native-exit-app-1.1.0.tgz",
|
|
48034
|
-
"integrity": "sha512-Spne19zfMfJvnUTX909EHUqWMk69rATtLJq9XMBGpNSHhx0M7v5yetx2Z87egBhLOqQm+CWfD/oxWzDG8rbIQA=="
|
|
48035
|
-
},
|
|
48036
48014
|
"react-native-gesture-handler": {
|
|
48037
48015
|
"version": "2.8.0",
|
|
48038
48016
|
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-2.8.0.tgz",
|
|
@@ -730,11 +730,11 @@ export default class RtcEngine {
|
|
|
730
730
|
|
|
731
731
|
async changeSpeaker(speakerId, callback, error) {
|
|
732
732
|
try {
|
|
733
|
-
this.speakerDeviceId = speakerId;
|
|
734
733
|
// setting sepeaker for all remote stream (previously joined users)
|
|
735
734
|
this.remoteStreams?.forEach((stream, uid, map) => {
|
|
736
735
|
stream?.audio?.setPlaybackDevice(speakerId);
|
|
737
736
|
});
|
|
737
|
+
this.speakerDeviceId = speakerId;
|
|
738
738
|
callback(speakerId);
|
|
739
739
|
} catch (e) {
|
|
740
740
|
error(e);
|
|
@@ -101,7 +101,8 @@ export type ComponentsInterface = {
|
|
|
101
101
|
*/
|
|
102
102
|
appRoot?: React.ComponentType;
|
|
103
103
|
// commented for v1 release
|
|
104
|
-
//precall?: PreCallInterface | React.ComponentType;
|
|
104
|
+
// precall?: PreCallInterface | React.ComponentType;
|
|
105
|
+
precall?: React.ComponentType;
|
|
105
106
|
//create?: React.ComponentType;
|
|
106
107
|
//share?: React.ComponentType;
|
|
107
108
|
//join?: React.ComponentType;
|
package/template/global.d.ts
CHANGED
|
@@ -98,9 +98,6 @@ interface ConfigInterface {
|
|
|
98
98
|
ICON_BG_COLOR: string;
|
|
99
99
|
TOOLBAR_COLOR: string;
|
|
100
100
|
ACTIVE_SPEAKER: boolean;
|
|
101
|
-
ENABLE_TOKEN_AUTH: boolean;
|
|
102
|
-
ENABLE_IDP_AUTH: boolean;
|
|
103
|
-
PROJECT_ID: string;
|
|
104
101
|
}
|
|
105
102
|
declare var $config: ConfigInterface;
|
|
106
103
|
declare module 'customization' {
|
package/template/index.wsdk.tsx
CHANGED
|
@@ -3,31 +3,13 @@ import SDKAppWrapper, {
|
|
|
3
3
|
AppBuilderSdkApi,
|
|
4
4
|
AppBuilderSdkApiInterface,
|
|
5
5
|
} from './src/SDKAppWrapper';
|
|
6
|
-
import SDKEvents from './src/utils/SdkEvents';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
import * as RN from 'react-native-web';
|
|
9
8
|
import './src/assets/font-styles.css';
|
|
10
9
|
export * from 'customization-api';
|
|
11
10
|
export * from 'customization-implementation';
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const clearEvent = {
|
|
16
|
-
clear: () => {},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const AppBuilderWebSdkApi: AppBuilderWebSdkInterface = {
|
|
20
|
-
...AppBuilderSdkApi,
|
|
21
|
-
// Override customize function for web-sdk
|
|
22
|
-
customize: (customization) => {
|
|
23
|
-
SDKEvents.emit('addFpe', customization);
|
|
24
|
-
clearEvent.clear = SDKEvents.on('addFpeInit', () => {
|
|
25
|
-
console.log('addFpeInit called');
|
|
26
|
-
SDKEvents.emit('addFpe', customization);
|
|
27
|
-
clearEvent.clear();
|
|
28
|
-
});
|
|
29
|
-
},
|
|
30
|
-
};
|
|
12
|
+
const AppBuilderWebSdkApi: AppBuilderSdkApiInterface = AppBuilderSdkApi;
|
|
31
13
|
|
|
32
14
|
// init code
|
|
33
15
|
class AppBuilder extends HTMLElement {
|
package/template/package.json
CHANGED
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"electron-updater": "4.3.9",
|
|
66
66
|
"exponential-backoff": "3.1.0",
|
|
67
67
|
"graphql": "15.5.0",
|
|
68
|
-
"jwt-decode": "3.1.2",
|
|
69
68
|
"nanoevents": "7.0.1",
|
|
70
69
|
"nanoid": "4.0.0",
|
|
71
70
|
"nosleep.js": "0.12.0",
|
|
@@ -74,7 +73,6 @@
|
|
|
74
73
|
"react-is": "18.0.0",
|
|
75
74
|
"react-native": "0.64",
|
|
76
75
|
"react-native-agora": "3.7.1",
|
|
77
|
-
"react-native-exit-app": "1.1.0",
|
|
78
76
|
"react-native-gesture-handler": "2.8.0",
|
|
79
77
|
"react-native-hyperlink": "0.0.19",
|
|
80
78
|
"react-native-inappbrowser-reborn": "3.5.1",
|
package/template/src/App.tsx
CHANGED
|
@@ -11,7 +11,18 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import React, {useState, useContext} from 'react';
|
|
13
13
|
import {Platform} from 'react-native';
|
|
14
|
+
import Join from './pages/Join';
|
|
15
|
+
import VideoCall from './pages/VideoCall';
|
|
16
|
+
import Create from './pages/Create';
|
|
17
|
+
import {Route, Switch, Redirect} from './components/Router';
|
|
18
|
+
import PrivateRoute from './components/PrivateRoute';
|
|
19
|
+
import OAuth from './components/OAuth';
|
|
20
|
+
import StoreToken from './components/StoreToken';
|
|
21
|
+
import {shouldAuthenticate} from './utils/common';
|
|
14
22
|
import KeyboardManager from 'react-native-keyboard-manager';
|
|
23
|
+
// commented for v1 release
|
|
24
|
+
//import {CustomRoutesInterface, CUSTOM_ROUTES_PREFIX} from 'customization-api';
|
|
25
|
+
//import {useCustomization} from 'customization-implementation';
|
|
15
26
|
import AppWrapper from './AppWrapper';
|
|
16
27
|
import {
|
|
17
28
|
MeetingInfoContextInterface,
|
|
@@ -20,9 +31,9 @@ import {
|
|
|
20
31
|
} from './components/meeting-info/useMeetingInfo';
|
|
21
32
|
import {SetMeetingInfoProvider} from './components/meeting-info/useSetMeetingInfo';
|
|
22
33
|
import {ShareLinkProvider} from './components/useShareLink';
|
|
23
|
-
import
|
|
34
|
+
import Endcall from './pages/Endcall';
|
|
24
35
|
|
|
25
|
-
//
|
|
36
|
+
//hook can't be used in the outside react function calls. so directly checking the platform.
|
|
26
37
|
if (Platform.OS === 'ios') {
|
|
27
38
|
KeyboardManager.setEnable(true);
|
|
28
39
|
KeyboardManager.setEnableAutoToolbar(false);
|
|
@@ -45,6 +56,35 @@ declare module 'agora-rn-uikit' {
|
|
|
45
56
|
}
|
|
46
57
|
|
|
47
58
|
const App: React.FC = () => {
|
|
59
|
+
//commented for v1 release
|
|
60
|
+
//const CustomRoutes = useCustomization((data) => data?.customRoutes);
|
|
61
|
+
// const RenderCustomRoutes = () => {
|
|
62
|
+
// try {
|
|
63
|
+
// return (
|
|
64
|
+
// CustomRoutes &&
|
|
65
|
+
// Array.isArray(CustomRoutes) &&
|
|
66
|
+
// CustomRoutes.length &&
|
|
67
|
+
// CustomRoutes?.map((item: CustomRoutesInterface, i: number) => {
|
|
68
|
+
// let RouteComponent = item?.isPrivateRoute ? PrivateRoute : Route;
|
|
69
|
+
// return (
|
|
70
|
+
// <RouteComponent
|
|
71
|
+
// path={CUSTOM_ROUTES_PREFIX + item.path}
|
|
72
|
+
// exact={item.exact}
|
|
73
|
+
// key={i}
|
|
74
|
+
// failureRedirectTo={
|
|
75
|
+
// item.failureRedirectTo ? item.failureRedirectTo : '/'
|
|
76
|
+
// }
|
|
77
|
+
// {...item.routeProps}>
|
|
78
|
+
// <item.component {...item.componentProps} />
|
|
79
|
+
// </RouteComponent>
|
|
80
|
+
// );
|
|
81
|
+
// })
|
|
82
|
+
// );
|
|
83
|
+
// } catch (error) {
|
|
84
|
+
// console.error('Error on rendering the custom routes');
|
|
85
|
+
// return null;
|
|
86
|
+
// }
|
|
87
|
+
// };
|
|
48
88
|
const [meetingInfo, setMeetingInfo] = useState<MeetingInfoContextInterface>(
|
|
49
89
|
MeetingInfoDefaultValue,
|
|
50
90
|
);
|
|
@@ -54,7 +94,40 @@ const App: React.FC = () => {
|
|
|
54
94
|
<SetMeetingInfoProvider value={{setMeetingInfo}}>
|
|
55
95
|
<MeetingInfoProvider value={{...meetingInfo}}>
|
|
56
96
|
<ShareLinkProvider>
|
|
57
|
-
<
|
|
97
|
+
<Switch>
|
|
98
|
+
{/* commented for v1 release */}
|
|
99
|
+
{/* {RenderCustomRoutes()} */}
|
|
100
|
+
<Route exact path={'/'}>
|
|
101
|
+
<Redirect to={'/create'} />
|
|
102
|
+
</Route>
|
|
103
|
+
<Route exact path={'/authenticate'}>
|
|
104
|
+
{shouldAuthenticate ? <OAuth /> : <Redirect to={'/'} />}
|
|
105
|
+
</Route>
|
|
106
|
+
<Route path={'/auth-token/:token'}>
|
|
107
|
+
<StoreToken />
|
|
108
|
+
</Route>
|
|
109
|
+
<Route exact path={'/join'}>
|
|
110
|
+
<Join />
|
|
111
|
+
</Route>
|
|
112
|
+
{/* Will be used in the future
|
|
113
|
+
<Route exact path={'/leave'}>
|
|
114
|
+
<Endcall />
|
|
115
|
+
</Route> */}
|
|
116
|
+
{shouldAuthenticate ? (
|
|
117
|
+
<PrivateRoute
|
|
118
|
+
path={'/create'}
|
|
119
|
+
failureRedirectTo={'/authenticate'}>
|
|
120
|
+
<Create />
|
|
121
|
+
</PrivateRoute>
|
|
122
|
+
) : (
|
|
123
|
+
<Route path={'/create'}>
|
|
124
|
+
<Create />
|
|
125
|
+
</Route>
|
|
126
|
+
)}
|
|
127
|
+
<Route path={'/:phrase'}>
|
|
128
|
+
<VideoCall />
|
|
129
|
+
</Route>
|
|
130
|
+
</Switch>
|
|
58
131
|
</ShareLinkProvider>
|
|
59
132
|
</MeetingInfoProvider>
|
|
60
133
|
</SetMeetingInfoProvider>
|
|
@@ -29,7 +29,6 @@ import Error from './components/common/Error';
|
|
|
29
29
|
import {ErrorProvider} from './components/common';
|
|
30
30
|
import {useCustomization} from 'customization-implementation';
|
|
31
31
|
import {LanguageProvider} from './language/useLanguage';
|
|
32
|
-
import {AuthProvider} from './auth/AuthProvider';
|
|
33
32
|
import {PropsConsumer} from 'agora-rn-uikit';
|
|
34
33
|
import ToastComponent from './components/ToastComponent';
|
|
35
34
|
import {ToastContext, ToastProvider} from './components/useToast';
|
|
@@ -100,21 +99,19 @@ const AppWrapper = (props: AppWrapperProps) => {
|
|
|
100
99
|
? `/${SdkJoinState.phrase}`
|
|
101
100
|
: '',
|
|
102
101
|
]}>
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
<
|
|
106
|
-
<
|
|
107
|
-
<
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</SessionProvider>
|
|
117
|
-
</AuthProvider>
|
|
102
|
+
<SessionProvider>
|
|
103
|
+
<ColorConfigure>
|
|
104
|
+
<DimensionProvider>
|
|
105
|
+
<LanguageProvider>
|
|
106
|
+
<ErrorProvider>
|
|
107
|
+
<Error />
|
|
108
|
+
<Navigation />
|
|
109
|
+
{props.children}
|
|
110
|
+
</ErrorProvider>
|
|
111
|
+
</LanguageProvider>
|
|
112
|
+
</DimensionProvider>
|
|
113
|
+
</ColorConfigure>
|
|
114
|
+
</SessionProvider>
|
|
118
115
|
</Router>
|
|
119
116
|
</GraphQLProvider>
|
|
120
117
|
</StorageProvider>
|
|
@@ -11,68 +11,65 @@ import SDKMethodEventsManager from './utils/SdkMethodEvents';
|
|
|
11
11
|
import App from './App';
|
|
12
12
|
import SdkApiContextProvider from './components/SdkApiContext';
|
|
13
13
|
import {Unsubscribe} from 'nanoevents';
|
|
14
|
+
import {deviceId} from './components/DeviceConfigure';
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
// ...p: Parameters<T>
|
|
17
|
-
// ) => PromiseLike<ReturnType<T>>;
|
|
18
|
-
//
|
|
19
|
-
// type takeOnlyFirstParam<T extends (...p: any) => void> = (
|
|
20
|
-
// p: Parameters<T>[0],
|
|
21
|
-
// ) => ReturnType<T>;
|
|
16
|
+
type meetingData = Partial<MeetingInfoContextInterface['data']>;
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
// Hard defined since its an api.
|
|
19
|
+
export interface AppBuilderSdkApiInterface {
|
|
20
|
+
customize: (customization: CustomizationApiInterface) => Promise<void>;
|
|
21
|
+
joinRoom: (roomDetails: string | meetingData) => Promise<meetingData>;
|
|
22
|
+
joinPrecall: (
|
|
23
|
+
roomDetails: string | meetingData,
|
|
24
|
+
) => Promise<[meetingData, () => void]>;
|
|
25
|
+
setMicrophone: (deviceId: deviceId) => Promise<void>;
|
|
26
|
+
setCamera: (deviceId: deviceId) => Promise<void>;
|
|
27
|
+
setSpeaker: (deviceId: deviceId) => Promise<void>;
|
|
28
|
+
muteAudio: (
|
|
29
|
+
mute: boolean | ((currentMute: boolean) => boolean),
|
|
30
|
+
) => Promise<void>;
|
|
31
|
+
muteVideo: (
|
|
32
|
+
mute: boolean | ((currentMute: boolean) => boolean),
|
|
33
|
+
) => Promise<void>;
|
|
34
|
+
createCustomization: (
|
|
35
|
+
customization: CustomizationApiInterface,
|
|
36
|
+
) => CustomizationApiInterface;
|
|
37
|
+
customEvents: typeof customEvents;
|
|
38
|
+
on: <T extends keyof userEventsMapInterface>(
|
|
39
|
+
userEventName: T,
|
|
40
|
+
cb: userEventsMapInterface[T],
|
|
41
|
+
) => Unsubscribe;
|
|
31
42
|
}
|
|
32
43
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// joinRoom: makeAsync<takeOnlyFirstParam<SdkMethodEvents['join']>>;
|
|
36
|
-
// joinPrecall: makeAsync<takeOnlyFirstParam<SdkMethodEvents['join']>>;
|
|
37
|
-
// createCustomization: (
|
|
38
|
-
// customization: CustomizationApiInterface,
|
|
39
|
-
// ) => CustomizationApiInterface;
|
|
40
|
-
// on: <T extends keyof userEventsMapInterface>(
|
|
41
|
-
// userEventName: T,
|
|
42
|
-
// callBack: userEventsMapInterface[T],
|
|
43
|
-
// ) => Unsubscribe;
|
|
44
|
-
// }
|
|
45
|
-
|
|
46
|
-
export const AppBuilderSdkApi = {
|
|
47
|
-
login: async (token: string) => {
|
|
48
|
-
return await SDKMethodEventsManager.emit('login', token);
|
|
49
|
-
},
|
|
50
|
-
logout: async () => {
|
|
51
|
-
return await SDKMethodEventsManager.emit('logout');
|
|
52
|
-
},
|
|
53
|
-
customize: async (customization: CustomizationApiInterface) => {
|
|
44
|
+
export const AppBuilderSdkApi: AppBuilderSdkApiInterface = {
|
|
45
|
+
customize: async (customization) => {
|
|
54
46
|
return await SDKMethodEventsManager.emit('customize', customization);
|
|
55
47
|
},
|
|
56
48
|
customEvents: customEvents,
|
|
57
|
-
|
|
58
|
-
await SDKMethodEventsManager.emit('join', roomDetails, false);
|
|
59
|
-
},
|
|
60
|
-
joinRoom: async (
|
|
61
|
-
roomDetails: string | Partial<MeetingInfoContextInterface['data']>,
|
|
62
|
-
) => {
|
|
49
|
+
joinRoom: async (roomDetails) => {
|
|
63
50
|
return await SDKMethodEventsManager.emit('join', roomDetails, true);
|
|
64
51
|
},
|
|
65
|
-
joinPrecall: async (
|
|
66
|
-
roomDetails: string | Partial<MeetingInfoContextInterface['data']>,
|
|
67
|
-
) => {
|
|
52
|
+
joinPrecall: async (roomDetails) => {
|
|
68
53
|
const t = await SDKMethodEventsManager.emit('join', roomDetails);
|
|
69
54
|
return t as unknown as [MeetingInfoContextInterface['data'], () => {}];
|
|
70
55
|
},
|
|
56
|
+
setMicrophone: async (deviceId) => {
|
|
57
|
+
return await SDKMethodEventsManager.emit('microphoneDevice', deviceId);
|
|
58
|
+
},
|
|
59
|
+
setSpeaker: async (deviceId) => {
|
|
60
|
+
return await SDKMethodEventsManager.emit('speakerDevice', deviceId);
|
|
61
|
+
},
|
|
62
|
+
setCamera: async (deviceId) => {
|
|
63
|
+
return await SDKMethodEventsManager.emit('cameraDevice', deviceId);
|
|
64
|
+
},
|
|
65
|
+
muteAudio: async (state) => {
|
|
66
|
+
return await SDKMethodEventsManager.emit('muteAudio', state);
|
|
67
|
+
},
|
|
68
|
+
muteVideo: async (state) => {
|
|
69
|
+
return await SDKMethodEventsManager.emit('muteVideo', state);
|
|
70
|
+
},
|
|
71
71
|
createCustomization: customize,
|
|
72
|
-
on:
|
|
73
|
-
userEventName: T,
|
|
74
|
-
cb: userEventsMapInterface[T],
|
|
75
|
-
): Unsubscribe => {
|
|
72
|
+
on: (userEventName, cb) => {
|
|
76
73
|
console.log('SDKEvents: Event Registered', userEventName);
|
|
77
74
|
return SDKEvents.on(userEventName, cb);
|
|
78
75
|
},
|
|
@@ -21,7 +21,6 @@ interface PopupProps extends ModalProps {
|
|
|
21
21
|
children: React.ReactNode;
|
|
22
22
|
contentContainerStyle?: ViewStyle;
|
|
23
23
|
containerStyle?: ViewStyle;
|
|
24
|
-
cancelable?: boolean;
|
|
25
24
|
}
|
|
26
25
|
const Popup = (props: PopupProps) => {
|
|
27
26
|
const {
|
|
@@ -30,7 +29,6 @@ const Popup = (props: PopupProps) => {
|
|
|
30
29
|
setModalVisible,
|
|
31
30
|
children,
|
|
32
31
|
showCloseIcon,
|
|
33
|
-
cancelable = true,
|
|
34
32
|
...otherProps
|
|
35
33
|
} = props;
|
|
36
34
|
|
|
@@ -53,7 +51,7 @@ const Popup = (props: PopupProps) => {
|
|
|
53
51
|
]}>
|
|
54
52
|
<TouchableWithoutFeedback
|
|
55
53
|
onPress={() => {
|
|
56
|
-
|
|
54
|
+
setModalVisible(false);
|
|
57
55
|
}}>
|
|
58
56
|
<View style={styles.backDrop} />
|
|
59
57
|
</TouchableWithoutFeedback>
|
|
@@ -81,14 +81,15 @@ const Chat = (props?: ChatProps) => {
|
|
|
81
81
|
|
|
82
82
|
const {primaryColor} = useContext(ColorContext);
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
84
|
+
//not need since state are controlled by chatUIControl
|
|
85
|
+
// React.useEffect(() => {
|
|
86
|
+
// return () => {
|
|
87
|
+
// // reset both the active tabs
|
|
88
|
+
// setGroupActive(false);
|
|
89
|
+
// setPrivateActive(false);
|
|
90
|
+
// setSelectedUser(0);
|
|
91
|
+
// };
|
|
92
|
+
// }, []);
|
|
92
93
|
|
|
93
94
|
const selectUser = (userUID: UidType) => {
|
|
94
95
|
setSelectedUser(userUID);
|