Video call and chat using WebRTC and Pubnub in native iOS Swift

984 Views Asked by At

I'm working on a doctor-patient appointment app on native iOS Swift project. Here I want to implement a live video call with chat using WebRTC and PubNub signaling server. I'm totally new to it. I don't know how to implement this. I have seen some of the Objective-C codes but still I didn't understand. Please help if any of you implement the same in swift.

2

There are 2 best solutions below

0
cbiggin On

I have implemented this in Swift (and previously in Objective C) but it is completely proprietary.

You are going to have to download the Google WebRTC framework.

Taking a quick look at PubNub, it looks like it just does signalling. You are still going to need an actual WebRTC server (eg, Janus). There are others and I'm not really sure which ones support PubNub.

0
Mathew Jenkinson On

Highly recommend you reach out to a service such as Vonage (https://www.vonage.com) who can provide HIPAA compliant WebRTC video service for you.

Once you have a set of keys on Vonage, you can use PubNub to move the video session details around the channel in question. Traditionally I use a JSON object model that looks like this:

channel: "UUID of medical session"
messageID: "MessageID on your platform"
messageType: "videoInvite"
sender: "Hilaj"
sessionDetails: "session JWT and/or session token"
timestamp: "1597347054"

This means you can send text based messages as well as video invites in the same channel and write the event to logs.