Browse Source

[RN] Allow to override callHandle for CallKit (coding style)

master
Lyubo Marinov 7 years ago
parent
commit
a82ed4653e

+ 5
- 6
react/features/base/config/functions.js View File

44
     'callDisplayName',
44
     'callDisplayName',
45
 
45
 
46
     /**
46
     /**
47
-     * The call handle of the CallKit call representing the conference/meeting
48
-     * associated with this config.js. The property is meant for use cases in
49
-     * which Jitsi Meet is to work with a CallKit call created outside of Jitsi
50
-     * Meet and to be adopted by Jitsi Meet such as, for example, an incoming
51
-     * and/or outgoing CallKit call created by Jitsi Meet SDK for iOS
52
-     * clients/consumers prior to giving control to Jitsi Meet. As the value is
47
+     * The handle
48
+     * ({@link https://developer.apple.com/documentation/callkit/cxhandle}) of
49
+     * the CallKit call representing the conference/meeting associated with this
50
+     * config.js. The property is meant for use cases in which the room URL is
51
+     * not desirable as the handle for CallKit purposes. As the value is
53
      * associated with a conference/meeting, the value makes sense not as a
52
      * associated with a conference/meeting, the value makes sense not as a
54
      * deployment-wide configuration, only as a runtime configuration
53
      * deployment-wide configuration, only as a runtime configuration
55
      * override/overwrite provided by, for example, Jitsi Meet SDK for iOS.
54
      * override/overwrite provided by, for example, Jitsi Meet SDK for iOS.

+ 3
- 4
react/features/mobile/callkit/middleware.js View File

227
 
227
 
228
     const { conference } = action;
228
     const { conference } = action;
229
     const state = getState();
229
     const state = getState();
230
-    const { callUUID, callHandle } = state['features/base/config'];
230
+    const { callHandle, callUUID } = state['features/base/config'];
231
     const url = getInviteURL(state);
231
     const url = getInviteURL(state);
232
+    const handle = callHandle || url.toString();
232
     const hasVideo = !isVideoMutedByAudioOnly(state);
233
     const hasVideo = !isVideoMutedByAudioOnly(state);
233
 
234
 
234
     // When assigning the call UUID, do so in upper case, since iOS will return
235
     // When assigning the call UUID, do so in upper case, since iOS will return
235
     // it upper cased.
236
     // it upper cased.
236
     conference.callUUID = (callUUID || uuid.v4()).toUpperCase();
237
     conference.callUUID = (callUUID || uuid.v4()).toUpperCase();
237
 
238
 
238
-    const handleURL = callHandle || url.toString();
239
-
240
-    CallKit.startCall(conference.callUUID, handleURL, hasVideo)
239
+    CallKit.startCall(conference.callUUID, handle, hasVideo)
241
         .then(() => {
240
         .then(() => {
242
             const { callee } = state['features/base/jwt'];
241
             const { callee } = state['features/base/jwt'];
243
             const displayName
242
             const displayName

Loading…
Cancel
Save