Mc Sibi
Mc Sibi

Reputation: 119

Integrating PubNub WebRTC SDK for iOS

I Am stuck with integrating the PubNub WebRTC SDK for iOS application.

Its a JavaScript SDK. How To integrate this with my iOS app.

Thanks in advance.....

Upvotes: 3

Views: 733

Answers (1)

Craig Conover
Craig Conover

Reputation: 4738

This does not directly answer the Objective-C implementation, but it might help with understanding the overall solution and the role that PubNub plays.

Why PubNub? - Signaling

WebRTC is not a standalone API, it needs a signaling service to coordinate communication. Metadata needs to be sent between callers before a connection can be established. This metadata includes information such as:

  • Session control messages to open and close connections
  • Error messages
  • Codecs/Codec settings, bandwidth and media types
  • Keys to establish a secure connection
  • Network data such as host IP and port

Once signaling has taken place, video/audio/data is streamed directly between clients, using WebRTC’s PeerConnection API. This peer-to-peer direct connection allows you to stream high-bandwidth robust data, such as video. HTML5Rocks provides a great guide on all things WebRTC (no need to read as it is summarize below).

PubNub makes this signaling incredibly simple, and in addition, gives you the power to do so much more with your WebRTC applications.

What PubNub is Not

PubNub is not a server for WebRTC. A signaling service specifies ICE servers that the video chat can stream over. Public STUN servers provided by google can be used, but they are not very reliable. STUN or TURN servers are required to circumnavigate a firewall, else chat will fail. Many services provide the “total package” of signaling and server in one, that is not PN. Our audience are the people who want to build their own, more custom service.

XirSys

XirSys already have a WebRTC-PubNub demo using rails on their GitHub. They host STUN and TURN servers catering to the needs of WebRTC.

Open Source

There are a few open source STUN and TURN server projects that can be downloaded and hosted with ease:

  • Amazon AWS VM: Pre-made ready to deploy
  • RFC5766 TURN: Google Code, TURN server
  • One-to-many: Instructions on MCU for 1-to-many media servers. Necessary for large group chats and streams with hundreds+ users.

So as you can see, we do not provide audio/video streaming services but if you are building this solution, PubNub is a necessary piece to tie it all together with the signal protocol.

AndroidRTC

And here is an PubNub AndroidRTC example by our interns.

Upvotes: 1

Related Questions