PubNub iOS WebRTC Integration - ios

I am trying to use PubNub as the signaling server for a webRTC iOS app. I am using Xirsys for the ICE servers. I have been able to get my app working with googles AppRTC framework, but I can't seem to find any good information on integrating with PubNub as the signaling server.What is the best way to integrate PubNub with webRTC on an iOS app? This app is writen in Swift/Obj-C Thanks!

PubNub as Signal Protocol
You are just going to integrate the PubNub JavaScript SDK into your app to signal (publish a message on a channel) from one client to the other the details of how to connect. This KB article may be helpful to you: Does PubNub provide WebRTC and video chat?

Use Pubnub sdk - https://www.pubnub.com/docs/swift/pubnub-swift-sdk
It is available for both swift and Objective C.
You need to create your own steps for SDP and ICE Candidates signalling via Pubnub. Refer - https://www.tutorialspoint.com/webrtc/webrtc_signaling.htm
Or you can refer the sample webrtc iOS App just to see what message status they have maintained for signalling purpose. Refer - https://github.com/Mahabali/Apprtc-swift
You can make robust signalling process based on your app or project requirement.

Related

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

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.
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.
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.

Socket.io vs xmpp for a mobile chat app

I have to build a realtime chat app in iOS, which can later also have voice and video calling. I want to use a scalable and light weight solution integrated with the backend, making sure that the solution also supports calling in the future.
I'm not too sure if socket.io supports voice and video calls; Should I use that or xmpp? Or any other similar solution?
As it was written above socket.io is a chat server implementation using Websockets, while XMPP is a protocol.
I'd recommend using an XMPP chat server in this case.
For audio/video calls implementation you will need to implement signaling via XMPP to establish connection between the devices before the call.
Also for audio/video chat implementation you will need STUN/TURN/ICE server and you will need to add client-side implementation for passing media streams from peer-to-peer if you choose WebRTC peer-to-peer option.
There is an easier way as well. You can use a ready XMPP based server and SDK to build your app. For example, ConnectyCube provides such service.
They have a ready backend and SDKs you can use for building chat and audio/video chat apps. Also they already have a TURN server, so you do not need to worry about this part too.

iOS - XMPP with WebRTC for realtime video call or chat

I have searched the whole web but did not get any document for passing the XMPP IQ to WebRTC. Also I see is the XMPP Jingle class, but cannot find any document for integrate this.
Can someone help me with setting up a two-way video call using XMPP and WebRTC? By providing a working sample of Objective-C code?
I have tried:
Checking https://github.com/YK-Unit/AppRTCDemo and many other Github projects.
Are you want to support different platforms to get live video streaming?
So, i have a very good experience with https://www.nanocosmos.de/ library.
It's supports iOS, Android and Web. Has demo applications and trial period.
About documentation:
XMPP Framework: https://github.com/robbiehanson/XMPPFramework/wiki/IntroToFramework
It's very good documented.
WebRTC Native Code:
https://webrtc.org/native-code/ios/
It's contains all information about WebRTC.

WebRTC for iOS for VoIP communication

Is there any WebRTC solution for iOS for free with easy setup?
I tried to use http://www.webrtc.org/native-code/ios because our web end is already done with its web api and I thought I may not have other way around for letting calls go between web and iOS too. But iOS API's setup is very tedious and time taking (The downloading of WebRTC checkout is taking like lives with no gain).
I searched around and found a few like tokBox and quickblox but they are not free.
Did you look at RestComm iOS SDK ? It supports WebRTC Audio only right now but we are working on adding video in the next few weeks. Also it uses SIP as a signalling protocol.
https://github.com/Mobicents/restcomm-ios-sdk
http://www.telestax.com/how-to-integrate-the-restcomm-ios-client-sdk-in-your-app/
http://docs.telestax.com/restcomm-client-ios-sdk-quick-start/
Take a look at https://github.com/oney/RCTWebRTCDemo .
This is a React Native WebRTC project which works on iOS and Android and also has a signaling server example (but you can also use the online version for quick tests!).
Since the WebRTC requires DTLS-RTP, RTCP-FB, ICE and a lot of other newest standards, but the VoIP standards are old about 10+ years, therefore you need setup a gateway to convert the signaling and transcoding the RTP.
With the WebRTC Gateway, in the browser side, you can create the HTML5 application to connect to WebRTC gateway, the gateway will communicates with your PBX, and your iOS client connects to your PBX, then the call can be established between browser with iOS client app.

Working with WebRTC on IOS

I am happy that I got Video Chat working with WebRTC on iOS by following the tutorial here:
http://ninjanetic.com/how-to-get-started-with-webrtc-and-ios-without-wasting-10-hours-of-your-life/
But, I am not able to understand how is it Peer to Peer Video Chat when I am connecting to the appspot server (Google App Engine using Channel). Is it possible to remove this appspot. I have my own client verification system. So, I am pretty sure to maintain the proper authentication of who is going to connect to whom.
The GAE channel is used for signaling. Signaling is not part of webrtc and you can use any signaling method you like.
"Exchange of information via signaling must have completed successfully
before peer-to-peer streaming can begin"
You can find more information here and here

Resources