Browse Source

feat(react-native-sdk): add ENDPOINT_MESSAGE_RECEIVED to rnsdk events (#14889)

* feat(react-native-sdk): add ENDPOINT_MESSAGE_RECEIVED to react native SDK event listeners
factor2
Calinteodor 11 months ago
parent
commit
782d46b4a6
No account linked to committer's email address

+ 2
- 0
react-native-sdk/index.tsx View File

30
     onConferenceLeft?: Function;
30
     onConferenceLeft?: Function;
31
     onConferenceWillJoin?: Function;
31
     onConferenceWillJoin?: Function;
32
     onEnterPictureInPicture?: Function;
32
     onEnterPictureInPicture?: Function;
33
+    onEndpointMessageReceived?: Function;
33
     onParticipantJoined?: Function;
34
     onParticipantJoined?: Function;
34
     onParticipantLeft?: ({ id }: { id: string }) => void;
35
     onParticipantLeft?: ({ id }: { id: string }) => void;
35
     onReadyToClose?: Function;
36
     onReadyToClose?: Function;
133
                     onConferenceWillJoin: eventListeners?.onConferenceWillJoin,
134
                     onConferenceWillJoin: eventListeners?.onConferenceWillJoin,
134
                     onConferenceLeft: eventListeners?.onConferenceLeft,
135
                     onConferenceLeft: eventListeners?.onConferenceLeft,
135
                     onEnterPictureInPicture: eventListeners?.onEnterPictureInPicture,
136
                     onEnterPictureInPicture: eventListeners?.onEnterPictureInPicture,
137
+                    onEndpointMessageReceived: eventListeners?.onEndpointMessageReceived,
136
                     onParticipantJoined: eventListeners?.onParticipantJoined,
138
                     onParticipantJoined: eventListeners?.onParticipantJoined,
137
                     onParticipantLeft: eventListeners?.onParticipantLeft,
139
                     onParticipantLeft: eventListeners?.onParticipantLeft,
138
                     onReadyToClose: eventListeners?.onReadyToClose
140
                     onReadyToClose: eventListeners?.onReadyToClose

+ 0
- 5
react-native-sdk/update_dependencies.js View File

21
 
21
 
22
     for (const key in RNSDKpackageJSON.peerDependencies) {
22
     for (const key in RNSDKpackageJSON.peerDependencies) {
23
         if (!packageJSON.dependencies.hasOwnProperty(key)) {
23
         if (!packageJSON.dependencies.hasOwnProperty(key)) {
24
-
25
-            if (packageJSON.devDependencies.hasOwnProperty('@react-native/metro-config')) {
26
-                continue;
27
-            }
28
-
29
             packageJSON.dependencies[key] = RNSDKpackageJSON.peerDependencies[key];
24
             packageJSON.dependencies[key] = RNSDKpackageJSON.peerDependencies[key];
30
             updated = true;
25
             updated = true;
31
         }
26
         }

+ 21
- 11
react/features/mobile/react-native-sdk/middleware.js View File

4
     CONFERENCE_FOCUSED,
4
     CONFERENCE_FOCUSED,
5
     CONFERENCE_JOINED,
5
     CONFERENCE_JOINED,
6
     CONFERENCE_LEFT,
6
     CONFERENCE_LEFT,
7
-    CONFERENCE_WILL_JOIN
7
+    CONFERENCE_WILL_JOIN,
8
+    ENDPOINT_MESSAGE_RECEIVED
8
 } from '../../base/conference/actionTypes';
9
 } from '../../base/conference/actionTypes';
9
 import { SET_AUDIO_MUTED, SET_VIDEO_MUTED } from '../../base/media/actionTypes';
10
 import { SET_AUDIO_MUTED, SET_VIDEO_MUTED } from '../../base/media/actionTypes';
10
 import { PARTICIPANT_JOINED, PARTICIPANT_LEFT } from '../../base/participants/actionTypes';
11
 import { PARTICIPANT_JOINED, PARTICIPANT_LEFT } from '../../base/participants/actionTypes';
29
 
30
 
30
     switch (type) {
31
     switch (type) {
31
     case SET_AUDIO_MUTED:
32
     case SET_AUDIO_MUTED:
32
-        rnSdkHandlers?.onAudioMutedChanged && rnSdkHandlers?.onAudioMutedChanged(action.muted);
33
+        rnSdkHandlers?.onAudioMutedChanged?.(action.muted);
33
         break;
34
         break;
34
     case SET_VIDEO_MUTED:
35
     case SET_VIDEO_MUTED:
35
-        rnSdkHandlers?.onVideoMutedChanged && rnSdkHandlers?.onVideoMutedChanged(Boolean(action.muted));
36
+        rnSdkHandlers?.onVideoMutedChanged?.(Boolean(action.muted));
36
         break;
37
         break;
37
     case CONFERENCE_BLURRED:
38
     case CONFERENCE_BLURRED:
38
-        rnSdkHandlers?.onConferenceBlurred && rnSdkHandlers?.onConferenceBlurred();
39
+        rnSdkHandlers?.onConferenceBlurred?.();
39
         break;
40
         break;
40
     case CONFERENCE_FOCUSED:
41
     case CONFERENCE_FOCUSED:
41
-        rnSdkHandlers?.onConferenceFocused && rnSdkHandlers?.onConferenceFocused();
42
+        rnSdkHandlers?.onConferenceFocused?.();
42
         break;
43
         break;
43
     case CONFERENCE_JOINED:
44
     case CONFERENCE_JOINED:
44
-        rnSdkHandlers?.onConferenceJoined && rnSdkHandlers?.onConferenceJoined();
45
+        rnSdkHandlers?.onConferenceJoined?.();
45
         break;
46
         break;
46
     case CONFERENCE_LEFT:
47
     case CONFERENCE_LEFT:
47
         //  Props are torn down at this point, perhaps need to leave this one out
48
         //  Props are torn down at this point, perhaps need to leave this one out
48
         break;
49
         break;
49
     case CONFERENCE_WILL_JOIN:
50
     case CONFERENCE_WILL_JOIN:
50
-        rnSdkHandlers?.onConferenceWillJoin && rnSdkHandlers?.onConferenceWillJoin();
51
+        rnSdkHandlers?.onConferenceWillJoin?.();
51
         break;
52
         break;
52
     case ENTER_PICTURE_IN_PICTURE:
53
     case ENTER_PICTURE_IN_PICTURE:
53
-        rnSdkHandlers?.onEnterPictureInPicture && rnSdkHandlers?.onEnterPictureInPicture();
54
+        rnSdkHandlers?.onEnterPictureInPicture?.();
54
         break;
55
         break;
56
+    case ENDPOINT_MESSAGE_RECEIVED: {
57
+        const { data, participant } = action;
58
+
59
+        rnSdkHandlers?.onEndpointMessageReceived?.({
60
+            data,
61
+            participant
62
+        });
63
+        break;
64
+    }
55
     case PARTICIPANT_JOINED: {
65
     case PARTICIPANT_JOINED: {
56
         const { participant } = action;
66
         const { participant } = action;
57
         const participantInfo = participantToParticipantInfo(participant);
67
         const participantInfo = participantToParticipantInfo(participant);
58
 
68
 
59
-        rnSdkHandlers?.onParticipantJoined && rnSdkHandlers?.onParticipantJoined(participantInfo);
69
+        rnSdkHandlers?.onParticipantJoined?.(participantInfo);
60
         break;
70
         break;
61
     }
71
     }
62
     case PARTICIPANT_LEFT: {
72
     case PARTICIPANT_LEFT: {
64
 
74
 
65
         const { id } = participant ?? {};
75
         const { id } = participant ?? {};
66
 
76
 
67
-        rnSdkHandlers?.onParticipantLeft && rnSdkHandlers?.onParticipantLeft({ id });
77
+        rnSdkHandlers?.onParticipantLeft?.({ id });
68
         break;
78
         break;
69
     }
79
     }
70
     case READY_TO_CLOSE:
80
     case READY_TO_CLOSE:
71
-        rnSdkHandlers?.onReadyToClose && rnSdkHandlers?.onReadyToClose();
81
+        rnSdkHandlers?.onReadyToClose?.();
72
         break;
82
         break;
73
     }
83
     }
74
 
84
 

Loading…
Cancel
Save