Proper use of JitsiMeetView in combination with JMCallKitProxy

Hi all!

I am currently integrating the Jitsi Meet SDK (v2.3.0) into our current messenger app on iOS (iOS 11+) to have voice and video calls.

At first, I created our own call with CallKit to show an incoming call screen and when the call was accepted, I created a JitsiMeetView, provided all the parameters and joined the Jitsi Meet session (and ended our own CallKit call, because Jitsi would create its own CallKit call).

It worked perfectly. However, I now decided to use JMCallKitProxy to streamline the call flow and to be able to just pass the call used for the setup of the “rendezvous” to the JitsiMeetView, so it can be reused.

Unfortunately, I am not sure, if the way I implemented it, is the correct one. The JitsiMeetView always creates a new call and I can not figure out how to get it to use the one I created earlier.

The basic business logic is like this:

  1. The app receives an VOiP push notification from the server

  2. The following code (Swift) is used to show an incoming call notification:

// Generate a new UUID to create a new CallKit Call
let callKitUUID = UUID()
        
// Display the incoming call
JMCallKitProxy.reportNewIncomingCall(UUID: callKitUUID, handle: displayName, displayName: displayName, hasVideo: hasVideo) { (error) in }
  1. When the user hits the “answer” button on the incoming call screen the delegate method performAnswerCall(UUID:) of JMCallKitListener is triggered and creates and shows a new JitsiMeetView like that:
extension CallManager: JMCallKitListener {
    
    func performAnswerCall(UUID: UUID) {
        
        print("CallKit call is answered.")
       
        // Show the jitsi conference view.
        jitsiViewController = CallViewController()
        methodToShowTheViewController()
    }
}

The setup of the JitsiMeetView is done in the viewDidLoad() method of the ViewController:

override func viewDidLoad() {
        super.viewDidLoad()
        
        jitsiMeetView = JitsiMeetView(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
        self.view.addSubview(jitsiMeetView!)
        
        jitsiMeetView!.delegate = self
        
        // create the request
        let url = URL(string: videoConfUrl)

        // fire off the request
        // make sure your class conforms to NSURLConnectionDelegate
        HTTPDataHandler.sharedInstance.getRedirectLink(forUrl: url!) { (jitsiLink) in
            GlobalMainQueue.async {

                // Construct the jitsi url
                if let jitsiUrl = URL(string: jitsiLink) {
                    
                    // Set the options for the conference
                    let conferenceOptions = JitsiMeetConferenceOptions.fromBuilder({ (builder) in
                        builder.serverURL = jitsiUrl
                        builder.room = jitsiUrl.relativeString
                        builder.audioOnly = false
                        builder.audioMuted = false
                        builder.videoMuted = false
                        builder.welcomePageEnabled = false
                        builder.setFeatureFlag("chat.enabled", withBoolean: false)
                    })
                    
                    // Join the conference
                    self.jitsiMeetView!.join(conferenceOptions)
                } 
            }
        }
    }

Is this current flow the correct way of doing this properly? As I said, everything works perfectly except that the JitsiMeetView will create a new call instance. How do I provide the UUID of the call I want to use to the JitsiMeetView? I browsed the code and the docs and could not figure it out.

Thank you for your help!

Update: If there is any good ressource out there, how to use JMCallKitProxy for advanced call flows, I would also appreciate it, if you could point me to it. I only found the two basic examples on GitHub, which do not help me with this.