WebRTC for iOS for VoIP communication - ios

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.

Related

Does the WKWebView support websocket?

I have very short question. I'm starting to develop an app, which is targeted to Android, but why not try to use it on iOS? Application has WebView only and it will use WebSocket for communication.
My question is, does the UIWebView support WebSocket or is it necessary to use external libraries? I don't have an Apple device to check and didn't find any information in the internet.
Thanks for any hint.
EDIT:I've read that UIWebView is deprecated. What about WKWebView?
I have found that WKWebView does support Web Sockets. What really surprised me is it also supports keeping the websockets open in the background (assuming you have the appropriate requirements set up in your app). You can then pass messages to the native side as required using the messageHandlers.postMessage mechanism.
Alternatively if you wanted to take a more native approach you could use SocketRocket which is a library developed by Facebook

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.

Video Streaming and Broadcasting using WebRTC

I am very new to Real Time Protocols and I had some questions about how WebRTC works and how I can implement it. I am trying to create a one to many livestream like facebook or periscope, where one user broadcasts and other users join and stream the video. I am using Swift from my client end.
My questions are:
How do I broadcast a video using WebRTC
Is there an SDK for WebRTC in Swift/iOS
I know the questions are very vague but a guidance to the right direction would be great because I am not sure where to start
You will need to use backend servers for that.
If you plan on broadcasting to multiple users directly from your mobile app then stop...
You need to connect your mobile app to a backend media server which then can be used to broadcast the video to a larger audience.
There are several commercial and open source alternatives that enable you to do that. I'd check Red5Pro, Wowza, SwitchRTC, Jitsi, Janus and Kurento for this task.
For the client side, look at react-native-webrtc
You can find more tools for WebRTC developers here.
Regarding your question (2), there's also a SDK for iOS here and a neat get-started-page here (although 2.5ys old, but I haven't found anything better so far yet)

iOS XMPP vs WebRTC, which should I use?

I want to build an iOS application that people can video call or audio call to each other. Stable calling is my goal, and it means I need less connection interrupt as much as good, I also need light application (not too high application size because of video libraries)
I've googled about "ios video chat' keywords since last few days. Researched and found that the most popular framework (technology, library) for video/audio calling are XMPP and WebRTC (I'm I right or do guys have something better?)
XMPP - Client/server TCP communication
WebRTC - P2P Connection
The information about these libraries make me confused, so which library I should use for better performance, light application, stable?
Any idea?
XMPP is about signaling (reaching from A to B, indicating the desire to have a "call", disconnecting, etc).
WebRTC is about media (actually sending voice and video).
You need both signaling and media in your app.
For media use WebRTC. There's nothing else that will make sense. On iOS, it is kind of tricky at the moment, as iOS 11 incorporates WebRTC already, so how this will apply and help you in your development is yet to be seen (see here).
My suggestion is to aim for a web app and then figure out if you need to go for a fully native implementation and port WebRTC to iOS - or just use a webview inside an app (Cordova or Crosswalk should do).
For signaling, you can use XMPP. Or anything else for that matter. My own personal preference is a proprietary protocol. Look at Matrix or SimpleWebRTC for that.
Also - don't forget that you will need to deal with STUN and TURN - NAT traversal, but that's a simpler thing to handle.
XMPP Framework: https://github.com/robbiehanson/XMPPFramework/wiki/IntroToFramework
WebRTC Native Code: https://webrtc.org/native-code/ios/
its not about which is best its about what fulfills our requirements

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