agora-appbuilder-core 2.3.0-beta.9 → 3.0.0

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 (205) hide show
  1. package/Readme.md +11 -6
  2. package/package.json +1 -1
  3. package/template/Gulpfile.js +121 -83
  4. package/template/_gitignore +2 -2
  5. package/template/_package-lock.json +12959 -13248
  6. package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
  7. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
  8. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
  9. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
  10. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
  11. package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
  12. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
  13. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
  14. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
  15. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
  16. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
  17. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -5
  18. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
  19. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
  20. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
  21. package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
  22. package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
  23. package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
  24. package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
  25. package/template/babel.config.js +9 -9
  26. package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
  27. package/template/customization-api/action-library.ts +22 -0
  28. package/template/{fpe-api/context.ts → customization-api/app-state.ts} +16 -14
  29. package/template/customization-api/customEvents.ts +9 -0
  30. package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
  31. package/template/{fpe-api → customization-api}/index.ts +11 -6
  32. package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
  33. package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
  34. package/template/customization-api/utils.ts +30 -0
  35. package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
  36. package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
  37. package/template/customization-implementation/index.ts +4 -0
  38. package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
  39. package/template/{fpe.config.js → customization.config.js} +11 -11
  40. package/template/electron/main/index.js +42 -35
  41. package/template/esbuild.rsdk.go +8 -17
  42. package/template/global.d.ts +4 -3
  43. package/template/index.rsdk.tsx +13 -5
  44. package/template/index.wsdk.tsx +21 -5
  45. package/template/package.json +3 -0
  46. package/template/react-native-toast-message/src/index.js +3 -7
  47. package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
  48. package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
  49. package/template/src/App.tsx +8 -4
  50. package/template/src/AppWrapper.tsx +8 -6
  51. package/template/src/SDKAppWrapper.tsx +28 -21
  52. package/template/src/app-state/useLocalUserInfo.ts +8 -0
  53. package/template/src/app-state/useMessages.ts +52 -0
  54. package/template/src/atoms/PrimaryButton.tsx +2 -2
  55. package/template/src/atoms/SecondaryButton.tsx +12 -4
  56. package/template/src/atoms/TextInput.tsx +2 -2
  57. package/template/src/components/Chat.tsx +22 -11
  58. package/template/src/components/ChatContext.ts +10 -27
  59. package/template/src/components/Controls.native.tsx +13 -7
  60. package/template/src/components/Controls.tsx +15 -24
  61. package/template/src/components/DeviceConfigure.tsx +4 -3
  62. package/template/src/components/EventsConfigure.tsx +54 -0
  63. package/template/src/components/GridVideo.tsx +5 -6
  64. package/template/src/components/HostControlView.tsx +13 -19
  65. package/template/src/components/Navbar.tsx +54 -41
  66. package/template/src/components/NetworkQualityContext.tsx +4 -3
  67. package/template/src/components/ParticipantsView.tsx +7 -7
  68. package/template/src/components/PinnedVideo.tsx +3 -4
  69. package/template/src/components/Precall.native.tsx +3 -3
  70. package/template/src/components/Precall.tsx +14 -10
  71. package/template/src/components/RTMConfigure.tsx +61 -219
  72. package/template/src/components/SettingsView.tsx +6 -3
  73. package/template/src/components/Share.tsx +24 -18
  74. package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
  75. package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
  76. package/template/src/components/chat-ui/useChatUIControl.tsx +1 -1
  77. package/template/src/components/common/Logo.tsx +3 -2
  78. package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
  79. package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
  80. package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
  81. package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
  82. package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
  83. package/template/src/components/meeting-info/useMeetingInfo.tsx +23 -19
  84. package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
  85. package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
  86. package/template/src/components/participants/AllHostParticipants.tsx +4 -4
  87. package/template/src/components/participants/MeParticipant.tsx +5 -3
  88. package/template/src/components/participants/ParticipantName.tsx +2 -2
  89. package/template/src/components/participants/RemoteParticipants.tsx +9 -7
  90. package/template/src/components/precall/LocalMute.native.tsx +14 -10
  91. package/template/src/components/precall/LocalMute.tsx +7 -5
  92. package/template/src/components/precall/VideoPreview.native.tsx +6 -6
  93. package/template/src/components/precall/VideoPreview.tsx +3 -3
  94. package/template/src/components/precall/joinCallBtn.tsx +3 -3
  95. package/template/src/components/precall/meetingTitle.tsx +3 -1
  96. package/template/src/components/precall/selectDevice.tsx +2 -2
  97. package/template/src/components/precall/usePreCall.tsx +1 -1
  98. package/template/src/components/styles.ts +3 -3
  99. package/template/src/components/useShareLink.tsx +69 -29
  100. package/template/src/components/useUserPreference.tsx +16 -15
  101. package/template/src/components/useWakeLock.tsx +3 -3
  102. package/template/src/language/i18nTypes.ts +1 -1
  103. package/template/src/language/index.ts +2 -2
  104. package/template/src/language/useLanguage.tsx +2 -3
  105. package/template/src/pages/Authenticate.tsx +3 -2
  106. package/template/src/pages/Create.tsx +18 -20
  107. package/template/src/pages/Join.tsx +6 -7
  108. package/template/src/pages/VideoCall.tsx +74 -66
  109. package/template/src/pages/create/useCreate.tsx +1 -1
  110. package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
  111. package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
  112. package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
  113. package/template/src/pages/video-call/RenderComponent.tsx +7 -10
  114. package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
  115. package/template/src/pages/video-call/VideoComponent.tsx +13 -15
  116. package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
  117. package/template/src/pages/video-call/useLayoutsData.ts +23 -0
  118. package/template/src/rtm/RTMEngine.ts +13 -0
  119. package/template/src/rtm-events/EventUtils.ts +20 -20
  120. package/template/src/rtm-events/EventsQueue.ts +9 -3
  121. package/template/src/rtm-events/constants.ts +5 -0
  122. package/template/src/rtm-events/index.tsx +1 -3
  123. package/template/src/{custom-events/CustomEvents.ts → rtm-events-api/Events.ts} +67 -61
  124. package/template/src/rtm-events-api/index.tsx +6 -0
  125. package/template/src/rtm-events-api/types.ts +22 -0
  126. package/template/src/subComponents/ChatBubble.tsx +24 -8
  127. package/template/src/subComponents/ChatContainer.tsx +24 -15
  128. package/template/src/subComponents/ChatInput.tsx +56 -42
  129. package/template/src/subComponents/LanguageSelector.tsx +2 -2
  130. package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
  131. package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
  132. package/template/src/subComponents/LocalAudioMute.tsx +3 -4
  133. package/template/src/subComponents/LocalEndCall.tsx +3 -6
  134. package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
  135. package/template/src/subComponents/LocalVideoMute.tsx +3 -3
  136. package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
  137. package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
  138. package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
  139. package/template/src/subComponents/RemoteEndCall.tsx +3 -10
  140. package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
  141. package/template/src/subComponents/SelectDevice.tsx +1 -1
  142. package/template/src/subComponents/SelectOAuth.tsx +3 -2
  143. package/template/src/subComponents/SidePanelButtons.ts +6 -5
  144. package/template/src/subComponents/TextWithTooltip.tsx +6 -2
  145. package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
  146. package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
  147. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
  148. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
  149. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
  150. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
  151. package/template/src/subComponents/livestream/index.ts +2 -2
  152. package/template/src/subComponents/recording/useRecording.tsx +44 -23
  153. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
  154. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
  155. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +97 -38
  156. package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
  157. package/template/src/utils/SdkEvents.ts +9 -46
  158. package/template/src/utils/common.tsx +25 -9
  159. package/template/src/utils/getUniqueID.ts +5 -0
  160. package/template/src/utils/isMobileOrTablet.native.ts +2 -2
  161. package/template/src/utils/isMobileOrTablet.ts +21 -8
  162. package/template/src/utils/useButtonTemplate.tsx +1 -1
  163. package/template/src/utils/useCreateMeeting.ts +21 -10
  164. package/template/src/utils/useGetMeetingPhrase.ts +11 -8
  165. package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +3 -1
  166. package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +4 -4
  167. package/template/src/utils/{isHostUser.ts → useIsHost.ts} +13 -16
  168. package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +2 -2
  169. package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +0 -0
  170. package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +5 -6
  171. package/template/src/utils/useJoinMeeting.ts +8 -6
  172. package/template/src/utils/useLayout.tsx +5 -5
  173. package/template/src/utils/useMutePSTN.ts +5 -3
  174. package/template/src/utils/useMuteToggleLocal.ts +3 -4
  175. package/template/src/utils/useRemoteEndCall.ts +11 -10
  176. package/template/src/utils/useRemoteMute.ts +42 -20
  177. package/template/src/utils/useSidePanel.tsx +1 -1
  178. package/template/src/utils/useString.ts +2 -2
  179. package/template/src/utils/useUserName.ts +11 -0
  180. package/template/tsconfig_fpeApi.json +8 -9
  181. package/template/tsconfig_rsdk_index.json +8 -9
  182. package/template/tsconfig_wsdk_index.json +8 -9
  183. package/template/webpack.commons.js +9 -9
  184. package/template/webpack.rsdk.config.js +4 -2
  185. package/template/webpack.ts.config.js +6 -6
  186. package/template/webpack.wsdk.config.js +2 -1
  187. package/template/fpe-api/fpeEvents.ts +0 -9
  188. package/template/fpe-api/utils.ts +0 -61
  189. package/template/fpe-implementation/index.ts +0 -1
  190. package/template/fpe-todo.txt +0 -14
  191. package/template/src/components/RTMEvents.tsx +0 -84
  192. package/template/src/custom-events/index.tsx +0 -4
  193. package/template/src/custom-events/types.ts +0 -51
  194. package/template/src/pages/video-call/CustomLayout.ts +0 -17
  195. package/template/src/rtm-events/types.ts +0 -7
  196. package/template/src/utils/getMeetingInvite.ts +0 -53
  197. package/template/src/utils/useGroupMessages.ts +0 -24
  198. package/template/src/utils/useNavParams.ts +0 -6
  199. package/template/src/utils/useNavigateTo.ts +0 -8
  200. package/template/src/utils/usePrivateMessages.ts +0 -33
  201. package/template/src/utils/useSendControlMessage.ts +0 -51
  202. package/template/src/utils/useSendMessage.ts +0 -40
  203. package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
  204. package/template/src/utils/useUnreadMessageCount.ts +0 -50
  205. package/template/src/utils/useUserList.ts +0 -26
@@ -10,17 +10,17 @@
10
10
  *********************************************
11
11
  */
12
12
 
13
- import React, {useContext} from 'react';
13
+ import {useRender, useRtc} from 'customization-api';
14
+ import React from 'react';
14
15
  import {View} from 'react-native';
15
- import {MaxVideoView, RtcContext} from '../../../agora-rn-uikit';
16
- import useUserList from '../../utils/useUserList';
16
+ import {MaxVideoView} from '../../../agora-rn-uikit';
17
17
 
18
18
  const VideoPreview: React.FC = () => {
19
- const rtc = useContext(RtcContext);
19
+ const rtc = useRtc();
20
20
  rtc?.RtcEngine?.startPreview();
21
21
 
22
- const {renderList, renderPosition} = useUserList();
23
- const [maxUid] = renderPosition;
22
+ const {renderList, activeUids} = useRender();
23
+ const [maxUid] = activeUids;
24
24
 
25
25
  if (!maxUid) {
26
26
  return null;
@@ -10,15 +10,15 @@
10
10
  *********************************************
11
11
  */
12
12
 
13
+ import {useRender} from 'customization-api';
13
14
  import React from 'react';
14
15
  import {View} from 'react-native';
15
16
  import {MaxVideoView} from '../../../agora-rn-uikit';
16
- import useUserList from '../../utils/useUserList';
17
17
 
18
18
  const VideoPreview: React.FC = () => {
19
- const {renderList, renderPosition} = useUserList();
19
+ const {renderList, activeUids} = useRender();
20
20
 
21
- const [maxUid] = renderPosition;
21
+ const [maxUid] = activeUids;
22
22
 
23
23
  if (!maxUid) {
24
24
  return null;
@@ -20,7 +20,7 @@ import {useMeetingInfo} from '../meeting-info/useMeetingInfo';
20
20
  import useGetName from '../../utils/useGetName';
21
21
  import {useWakeLock} from '../../components/useWakeLock';
22
22
  import isMobileOrTablet from '../../utils/isMobileOrTablet';
23
- import {isWeb} from '../../utils/common';
23
+ import {isWebInternal} from '../../utils/common';
24
24
 
25
25
  const audio = new Audio(
26
26
  'https://dl.dropboxusercontent.com/s/1cdwpm3gca9mlo0/kick.mp3',
@@ -53,7 +53,7 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
53
53
  const onSubmit = () => {
54
54
  setCallActive(true);
55
55
  // Play a sound to avoid autoblocking in safari
56
- if (isWeb || isMobileOrTablet()) {
56
+ if (isWebInternal() || isMobileOrTablet()) {
57
57
  audio.volume = 0;
58
58
  audio.play().then(() => {
59
59
  // pause directly once played
@@ -61,7 +61,7 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
61
61
  });
62
62
  }
63
63
  // Avoid Sleep only on mobile browsers
64
- if (isWeb && isMobileOrTablet() && !awake) {
64
+ if (isWebInternal() && isMobileOrTablet() && !awake) {
65
65
  // Request wake lock
66
66
  request();
67
67
  }
@@ -3,7 +3,9 @@ import {Text, StyleSheet, View} from 'react-native';
3
3
  import {useMeetingInfo} from '../meeting-info/useMeetingInfo';
4
4
 
5
5
  const MeetingTitle: React.FC = () => {
6
- const {meetingTitle} = useMeetingInfo();
6
+ const {
7
+ data: {meetingTitle},
8
+ } = useMeetingInfo();
7
9
  return (
8
10
  <>
9
11
  <Text style={[style.titleHeading, {color: $config.PRIMARY_COLOR}]}>
@@ -12,7 +12,7 @@
12
12
 
13
13
  import React from 'react';
14
14
  import {View, StyleSheet, Text} from 'react-native';
15
- import {isWeb} from '../../utils/common';
15
+ import {isWebInternal} from '../../utils/common';
16
16
  import SelectDevice from '../../subComponents/SelectDevice';
17
17
  import {useString} from '../../utils/useString';
18
18
 
@@ -26,7 +26,7 @@ const selectDevice: React.FC = () => {
26
26
  <View
27
27
  style={{
28
28
  flex: 1,
29
- maxWidth: isWeb ? '25vw' : 'auto',
29
+ maxWidth: isWebInternal() ? '25vw' : 'auto',
30
30
  marginVertical: 30,
31
31
  }}>
32
32
  <SelectDevice />
@@ -10,7 +10,7 @@
10
10
  *********************************************
11
11
  */
12
12
  import React, {createContext} from 'react';
13
- import {createHook} from 'fpe-implementation';
13
+ import {createHook} from 'customization-implementation';
14
14
  import {ApolloError} from '@apollo/client';
15
15
 
16
16
  export interface PreCallContextInterface {
@@ -9,7 +9,7 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import {isWeb} from '../utils/common';
12
+ import {isWebInternal} from '../utils/common';
13
13
 
14
14
  const styles = {
15
15
  temp: {
@@ -19,8 +19,8 @@ const styles = {
19
19
  borderRadius: 15,
20
20
  },
21
21
  bottomBar: {
22
- flex: isWeb ? 1.3 : 1.6,
23
- paddingHorizontal: isWeb ? '20%' : '1%',
22
+ flex: isWebInternal() ? 1.3 : 1.6,
23
+ paddingHorizontal: isWebInternal() ? '20%' : '1%',
24
24
  backgroundColor: $config.SECONDARY_FONT_COLOR + 80,
25
25
  flexDirection: 'row',
26
26
  justifyContent: 'space-evenly',
@@ -10,20 +10,68 @@
10
10
  *********************************************
11
11
  */
12
12
 
13
- import {createHook} from 'fpe-implementation';
13
+ import {createHook} from 'customization-implementation';
14
14
  import React from 'react';
15
15
  import {useString} from '../utils/useString';
16
16
  import isSDKCheck from '../utils/isSDK';
17
17
  import Toast from '../../react-native-toast-message';
18
18
  import {useMeetingInfo} from './meeting-info/useMeetingInfo';
19
19
  import platform from '../subComponents/Platform';
20
- import {
21
- GetMeetingInviteID,
22
- GetMeetingInviteURL,
23
- } from '../utils/getMeetingInvite';
24
20
  import {MeetingInviteInterface} from '../language/default-labels/videoCallScreenLabels';
25
21
  import Clipboard from '../subComponents/Clipboard';
26
22
 
23
+ export const GetMeetingInviteURL = (
24
+ baseUrl: string,
25
+ isHost: boolean,
26
+ roomId: {
27
+ host?: string;
28
+ attendee?: string;
29
+ },
30
+ isSeparateHostLink: boolean,
31
+ ) => {
32
+ if (isHost) {
33
+ if (isSeparateHostLink) {
34
+ return {
35
+ host: `${baseUrl}/${roomId.host}`,
36
+ attendee: `${baseUrl}/${roomId.attendee}`,
37
+ };
38
+ } else {
39
+ return {
40
+ host: `${baseUrl}/${roomId.host}`,
41
+ };
42
+ }
43
+ } else {
44
+ return {
45
+ attendee: `${baseUrl}/${roomId.attendee}`,
46
+ };
47
+ }
48
+ };
49
+ export const GetMeetingInviteID = (
50
+ isHost: boolean,
51
+ roomId: {
52
+ host?: string;
53
+ attendee?: string;
54
+ },
55
+ isSeparateHostLink: boolean,
56
+ ) => {
57
+ if (isHost) {
58
+ if (isSeparateHostLink) {
59
+ return {
60
+ host: `${roomId.host}`,
61
+ attendee: `${roomId.attendee}`,
62
+ };
63
+ } else {
64
+ return {
65
+ host: `${roomId.host}`,
66
+ };
67
+ }
68
+ } else {
69
+ return {
70
+ attendee: `${roomId.attendee}`,
71
+ };
72
+ }
73
+ };
74
+
27
75
  export enum SHARE_LINK_CONTENT_TYPE {
28
76
  ATTENDEE = 1,
29
77
  HOST,
@@ -45,8 +93,9 @@ interface ShareLinkProvideProps {
45
93
  }
46
94
 
47
95
  const ShareLinkProvider = (props: ShareLinkProvideProps) => {
48
- const {meetingTitle, meetingPassphrase, isSeparateHostLink, isHost} =
49
- useMeetingInfo();
96
+ const {
97
+ data: {meetingTitle, roomId, pstn, isSeparateHostLink, isHost},
98
+ } = useMeetingInfo();
50
99
 
51
100
  //commmented for v1 release
52
101
  // const copiedToClipboardText = useString(
@@ -111,20 +160,15 @@ const ShareLinkProvider = (props: ShareLinkProvideProps) => {
111
160
  let stringToCopy = meetingInviteText({
112
161
  meetingName: meetingTitle,
113
162
  url: baseURL
114
- ? GetMeetingInviteURL(
115
- baseURL,
116
- isHost,
117
- meetingPassphrase,
118
- isSeparateHostLink,
119
- )
163
+ ? GetMeetingInviteURL(baseURL, isHost, roomId, isSeparateHostLink)
120
164
  : undefined,
121
165
  id: !baseURL
122
- ? GetMeetingInviteID(isHost, meetingPassphrase, isSeparateHostLink)
166
+ ? GetMeetingInviteID(isHost, roomId, isSeparateHostLink)
123
167
  : undefined,
124
- pstn: meetingPassphrase?.pstn
168
+ pstn: pstn
125
169
  ? {
126
- number: meetingPassphrase.pstn.number,
127
- pin: meetingPassphrase.pstn.pin,
170
+ number: pstn.number,
171
+ pin: pstn.pin,
128
172
  }
129
173
  : undefined,
130
174
  isHost,
@@ -144,11 +188,11 @@ const ShareLinkProvider = (props: ShareLinkProvideProps) => {
144
188
  const getAttendeeURLOrId = () => {
145
189
  let stringToCopy = '';
146
190
  let baseURL = getBaseURL();
147
- if (meetingPassphrase?.attendee) {
191
+ if (roomId?.attendee) {
148
192
  if (baseURL) {
149
- stringToCopy += `${baseURL}/${meetingPassphrase.attendee}`;
193
+ stringToCopy += `${baseURL}/${roomId.attendee}`;
150
194
  } else {
151
- stringToCopy += `${meetingPassphrase.attendee}`;
195
+ stringToCopy += `${roomId.attendee}`;
152
196
  }
153
197
  }
154
198
  return stringToCopy;
@@ -156,12 +200,12 @@ const ShareLinkProvider = (props: ShareLinkProvideProps) => {
156
200
 
157
201
  const getHostUrlOrId = () => {
158
202
  let stringToCopy = '';
159
- if (meetingPassphrase?.host) {
203
+ if (roomId?.host) {
160
204
  let baseURL = getBaseURL();
161
205
  if (baseURL) {
162
- stringToCopy += `${baseURL}/${meetingPassphrase.host}`;
206
+ stringToCopy += `${baseURL}/${roomId.host}`;
163
207
  } else {
164
- stringToCopy += `${meetingPassphrase.host}`;
208
+ stringToCopy += `${roomId.host}`;
165
209
  }
166
210
  }
167
211
  return stringToCopy;
@@ -169,12 +213,8 @@ const ShareLinkProvider = (props: ShareLinkProvideProps) => {
169
213
 
170
214
  const getPstn = () => {
171
215
  let stringToCopy = '';
172
- if (
173
- meetingPassphrase?.pstn &&
174
- meetingPassphrase.pstn?.number &&
175
- meetingPassphrase.pstn?.pin
176
- ) {
177
- stringToCopy += `${PSTNNumberText}: ${meetingPassphrase.pstn.number} ${PSTNPinText}: ${meetingPassphrase.pstn.pin}`;
216
+ if (pstn && pstn?.number && pstn?.pin) {
217
+ stringToCopy += `${PSTNNumberText}: ${pstn.number} ${PSTNPinText}: ${pstn.pin}`;
178
218
  }
179
219
 
180
220
  return stringToCopy;
@@ -11,14 +11,14 @@
11
11
  */
12
12
  import React, {useState, useContext, useEffect} from 'react';
13
13
  import {RenderInterface, useLocalUid} from '../../agora-rn-uikit';
14
- import {RtcContext} from '../../agora-rn-uikit';
15
14
  import {useString} from '../utils/useString';
16
15
  import StorageContext from './StorageContext';
17
- import CustomEvents, {EventLevel} from '../custom-events';
16
+ import events, {EventPersistLevel} from '../rtm-events-api';
18
17
  import {EventNames} from '../rtm-events';
19
18
  import useLocalScreenShareUid from '../utils/useLocalShareScreenUid';
20
- import {createHook} from 'fpe-implementation';
19
+ import {createHook} from 'customization-implementation';
21
20
  import ChatContext from './ChatContext';
21
+ import {useRtc} from 'customization-api';
22
22
 
23
23
  interface UserPreferenceContextInterface {
24
24
  displayName: string;
@@ -34,7 +34,7 @@ const UserPreferenceContext =
34
34
  const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
35
35
  const localUid = useLocalUid();
36
36
  const screenShareUid = useLocalScreenShareUid();
37
- const {dispatch} = useContext(RtcContext);
37
+ const {dispatch} = useRtc();
38
38
 
39
39
  const {store, setStore} = useContext(StorageContext);
40
40
  const {hasUserJoinedRTM} = useContext(ChatContext);
@@ -51,8 +51,8 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
51
51
  const getScreenShareName = (name: string) => `${name}'s screenshare`;
52
52
 
53
53
  useEffect(() => {
54
- CustomEvents.on(EventNames.NAME_ATTRIBUTE, (data) => {
55
- const value = JSON.parse(data?.payload?.value);
54
+ events.on(EventNames.NAME_ATTRIBUTE, (data) => {
55
+ const value = JSON.parse(data?.payload);
56
56
  if (value) {
57
57
  if (value?.uid) {
58
58
  updateRenderListState(value?.uid, {
@@ -64,13 +64,13 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
64
64
  }
65
65
  if (value?.screenShareUid) {
66
66
  updateRenderListState(value?.screenShareUid, {
67
- name: getScreenShareName(value?.name),
67
+ name: getScreenShareName(value?.name || userText),
68
68
  });
69
69
  }
70
70
  }
71
71
  });
72
72
  return () => {
73
- CustomEvents.off(EventNames.NAME_ATTRIBUTE);
73
+ events.off(EventNames.NAME_ATTRIBUTE);
74
74
  };
75
75
  }, []);
76
76
 
@@ -84,21 +84,22 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
84
84
  });
85
85
 
86
86
  //update local state for user and screenshare
87
- updateRenderListState(localUid, {name: displayName});
87
+ updateRenderListState(localUid, {name: displayName || userText});
88
88
  updateRenderListState(screenShareUid, {
89
- name: getScreenShareName(displayName),
89
+ name: getScreenShareName(displayName || userText),
90
90
  });
91
91
 
92
92
  if (hasUserJoinedRTM) {
93
93
  //update remote state for user and screenshare
94
- CustomEvents.send(EventNames.NAME_ATTRIBUTE, {
95
- value: JSON.stringify({
94
+ events.send(
95
+ EventNames.NAME_ATTRIBUTE,
96
+ JSON.stringify({
96
97
  uid: localUid,
97
98
  screenShareUid: screenShareUid,
98
- name: displayName,
99
+ name: displayName || userText,
99
100
  }),
100
- level: EventLevel.LEVEL2,
101
- });
101
+ EventPersistLevel.LEVEL2,
102
+ );
102
103
  }
103
104
  }, [displayName, hasUserJoinedRTM]);
104
105
 
@@ -1,10 +1,10 @@
1
1
  import NoSleep from 'nosleep.js';
2
2
  import React from 'react';
3
- import mobileAndTabletCheck from '../utils/isMobileOrTablet';
4
- import {isWeb} from '../utils/common';
3
+ import isMobileOrTablet from '../utils/isMobileOrTablet';
4
+ import {isWebInternal} from '../utils/common';
5
5
 
6
6
  const useWakeLock = () => {
7
- if (mobileAndTabletCheck() && isWeb) {
7
+ if (isMobileOrTablet() && isWebInternal()) {
8
8
  const noSleep = React.useMemo(() => new NoSleep(), []);
9
9
  const [awake, set] = React.useState(noSleep.isEnabled);
10
10
 
@@ -3,7 +3,7 @@ import {TextDataInterface} from './default-labels/index';
3
3
  export type I18nBaseType<T = any> = string | ((template: T) => string);
4
4
  export type I18nDynamicType = I18nBaseType<string>;
5
5
  export type I18nConditionalType = I18nBaseType<boolean>;
6
- export interface i18nInterface {
6
+ export interface I18nInterface {
7
7
  locale: string;
8
8
  label?: string;
9
9
  data: TextDataInterface;
@@ -9,9 +9,9 @@
9
9
  information visit https://appbuilder.agora.io.
10
10
  *********************************************
11
11
  */
12
- import {i18nInterface} from './i18nTypes';
12
+ import {I18nInterface} from './i18nTypes';
13
13
  import {DEFAULT_LABELS} from './default-labels/index';
14
- export const DEFAULT_I18_DATA: i18nInterface = {
14
+ export const DEFAULT_I18_DATA: I18nInterface = {
15
15
  label: 'English US',
16
16
  locale: 'en-us',
17
17
  data: DEFAULT_LABELS,
@@ -10,8 +10,7 @@
10
10
  *********************************************
11
11
  */
12
12
  import React, {createContext, useContext, useEffect, useState} from 'react';
13
- import {createHook} from 'fpe-implementation';
14
- import {useFpe} from 'fpe-api';
13
+ import {createHook, useCustomization} from 'customization-implementation';
15
14
  import {DEFAULT_I18_DATA} from './index';
16
15
  import StorageContext from '../components/StorageContext';
17
16
 
@@ -31,7 +30,7 @@ const LanguageContext = createContext<LanguageContextInterface>({
31
30
 
32
31
  const LanguageProvider = (props: LanguagePropsInterface) => {
33
32
  const {store, setStore} = useContext(StorageContext);
34
- const i18nData = useFpe((data) => data?.i18n);
33
+ const i18nData = useCustomization((data) => data?.i18n);
35
34
 
36
35
  //If language code is stored in the localstorage no longer available in fpe data
37
36
  //then we will update the localstorage value to default value
@@ -20,11 +20,12 @@ import {
20
20
  import Logo from '../subComponents/Logo';
21
21
  import OAuth from '../components/OAuth';
22
22
  import Illustration from '../subComponents/Illustration';
23
- import {hasBrandLogo} from '../utils/common';
23
+ import {useHasBrandLogo} from '../utils/common';
24
24
  import DimensionContext from '../components/dimension/DimensionContext';
25
25
  import {useString} from '../utils/useString';
26
26
 
27
27
  const Authenticate = () => {
28
+ const hasBrandLogo = useHasBrandLogo();
28
29
  const {getDimensionData} = useContext(DimensionContext);
29
30
  const [isDesktop, setIsDesktop] = useState(false);
30
31
  let onLayout = (e: LayoutChangeEvent) => {
@@ -46,7 +47,7 @@ const Authenticate = () => {
46
47
  style={style.full}
47
48
  resizeMode={'cover'}>
48
49
  <View style={style.main}>
49
- <View style={style.nav}>{hasBrandLogo && <Logo />}</View>
50
+ <View style={style.nav}>{hasBrandLogo() && <Logo />}</View>
50
51
  <View style={style.content}>
51
52
  <View style={style.leftContent}>
52
53
  <Text style={style.heading}>{oauthLoginLabel}</Text>
@@ -21,8 +21,8 @@ import Toast from '../../react-native-toast-message';
21
21
  import {ErrorContext} from '../components/common';
22
22
  import ShareLink from '../components/Share';
23
23
  import Logo from '../components/common/Logo';
24
- import {isWeb, isValidReactComponent} from '../utils/common';
25
- import {useFpe, useMeetingInfo} from 'fpe-api';
24
+ import {isWebInternal, isValidReactComponent} from '../utils/common';
25
+ import {useCustomization} from 'customization-implementation';
26
26
  import {useString} from '../utils/useString';
27
27
  import useCreateMeeting from '../utils/useCreateMeeting';
28
28
  import {CreateProvider} from './create/useCreate';
@@ -32,7 +32,7 @@ import {MeetingInfoDefaultValue} from '../components/meeting-info/useMeetingInfo
32
32
  import {useSetMeetingInfo} from '../components/meeting-info/useSetMeetingInfo';
33
33
 
34
34
  const Create = () => {
35
- const {CreateComponent} = useFpe((data) => {
35
+ const {CreateComponent} = useCustomization((data) => {
36
36
  let components: {
37
37
  CreateComponent?: React.ElementType;
38
38
  } = {};
@@ -61,9 +61,6 @@ const Create = () => {
61
61
  const [roomCreated, setRoomCreated] = useState(false);
62
62
  const createRoomFun = useCreateMeeting();
63
63
  const {setMeetingInfo} = useSetMeetingInfo();
64
- const {
65
- meetingPassphrase: {attendee, host, pstn},
66
- } = useMeetingInfo();
67
64
  //commented for v1 release
68
65
  // const createdText = useString('meetingCreatedNotificationLabel')();
69
66
  // const hostControlsToggle = useString<boolean>('hostControlsToggle');
@@ -86,17 +83,24 @@ const Create = () => {
86
83
  const haveMeetingID = 'Have a Meeting ID?';
87
84
 
88
85
  useEffect(() => {
89
- if (isWeb) {
86
+ if (isWebInternal()) {
90
87
  document.title = $config.APP_NAME;
91
88
  }
92
- SDKEvents.on('joinMeetingWithPhrase', (phrase) => {
93
- console.log(
94
- 'DEBUG(aditya)-SDKEvents: joinMeetingWithPhrase event called',
95
- );
96
- useJoin(phrase);
97
- });
89
+ const unbind = SDKEvents.on(
90
+ 'joinMeetingWithPhrase',
91
+ (phrase, resolve, reject) => {
92
+ console.log('SDKEvents: joinMeetingWithPhrase event called', phrase);
93
+ try {
94
+ setMeetingInfo(MeetingInfoDefaultValue);
95
+ history.push(phrase);
96
+ resolve();
97
+ } catch (error) {
98
+ reject(error);
99
+ }
100
+ },
101
+ );
98
102
  return () => {
99
- SDKEvents.off('joinMeetingWithPhrase');
103
+ unbind();
100
104
  };
101
105
  }, []);
102
106
 
@@ -104,12 +108,6 @@ const Create = () => {
104
108
  setRoomCreated(true);
105
109
  };
106
110
 
107
- useEffect(() => {
108
- if (attendee) {
109
- SDKEvents.emit('create', host, attendee, pstn);
110
- }
111
- }, [attendee]);
112
-
113
111
  const createRoomAndNavigateToShare = async (
114
112
  roomTitle: string,
115
113
  enablePSTN: boolean,
@@ -17,7 +17,7 @@ import Logo from '../subComponents/Logo';
17
17
  import {
18
18
  isValidReactComponent,
19
19
  shouldAuthenticate,
20
- hasBrandLogo,
20
+ useHasBrandLogo,
21
21
  } from '../utils/common';
22
22
  import LogoutButton from '../subComponents/LogoutButton';
23
23
  import PrimaryButton from '../atoms/PrimaryButton';
@@ -26,12 +26,12 @@ import HorizontalRule from '../atoms/HorizontalRule';
26
26
  import TextInput from '../atoms/TextInput';
27
27
  import Error from '../subComponents/Error';
28
28
  import {useString} from '../utils/useString';
29
- import useNavigateTo from '../utils/useNavigateTo';
30
- import {useFpe} from 'fpe-api';
29
+ import {useCustomization} from 'customization-implementation';
31
30
  import {useSetMeetingInfo} from '../components/meeting-info/useSetMeetingInfo';
32
31
  import {MeetingInfoDefaultValue} from '../components/meeting-info/useMeetingInfo';
33
32
 
34
33
  const Join = () => {
34
+ const hasBrandLogo = useHasBrandLogo();
35
35
  //commented for v1 release
36
36
  // const meetingIdInputPlaceholder = useString('meetingIdInputPlaceholder')();
37
37
  // const enterMeetingButton = useString('enterMeetingButton')();
@@ -41,7 +41,6 @@ const Join = () => {
41
41
  const createMeetingButton = 'Create Meeting';
42
42
  const history = useHistory();
43
43
  const [phrase, setPhrase] = useState('');
44
- const navigateTo = useNavigateTo();
45
44
  const [error, setError] = useState<null | {name: string; message: string}>(
46
45
  null,
47
46
  );
@@ -52,9 +51,9 @@ const Join = () => {
52
51
 
53
52
  const startCall = async () => {
54
53
  setMeetingInfo(MeetingInfoDefaultValue);
55
- navigateTo(phrase);
54
+ history.push(phrase);
56
55
  };
57
- const {JoinComponent} = useFpe((data) => {
56
+ const {JoinComponent} = useCustomization((data) => {
58
57
  let components: {
59
58
  JoinComponent?: React.ComponentType;
60
59
  } = {};
@@ -74,7 +73,7 @@ const Join = () => {
74
73
  ) : (
75
74
  <ScrollView contentContainerStyle={style.main}>
76
75
  <View style={style.nav}>
77
- {hasBrandLogo && <Logo />}
76
+ {hasBrandLogo() && <Logo />}
78
77
  {error ? <Error error={error} /> : <></>}
79
78
  </View>
80
79
  <View style={style.content}>