---
title: Tips for iOS & WebRTC Development with TokBox – WebRTC.ventures
description: "Facebook Messenger, Hangouts, Slack: Are you familiar with any of these apps? Do you know what they all have in common? The answer is all of them use WebRTC technology for client to client video conversations. Our team at WebRTC.ventures builds iOS apps like this with WebRTC, […]"
image: https://blog.webrtc.ventures/hubfs/Imported_Blog_Media/iOSDevelopmentTokbox.png
---

[Skip to content](https://blog.webrtc.ventures/2017/05/ios-webrtc-tokbox#main-content)

![WebRTC.ventures](https://blog.webrtc.ventures/hubfs/logo-main-light.svg)

- [WebRTC Services](https://webrtc.ventures/webrtc-development-services/)
  
  Show submenu for WebRTC Services 
  
    - [Assess](https://webrtc.ventures/services/assess/)
    - [Build](https://webrtc.ventures/services/build/)
    - [Integrate](https://webrtc.ventures/services/integrate/)
    - [Test](https://webrtc.ventures/services/test/)
    - [Manage](https://webrtc.ventures/services/manage/)
    - [Migrating From Twilio Video](https://webrtc.ventures/twilio-video/)
- Our Partners
  
  Show submenu for Our Partners 
  
    - [Amazon Chime SDK](https://webrtc.ventures/partners/amazon-chime-sdk/)
- Stories of Success
  
  Show submenu for Stories of Success 
  
    - [Remote Video Interpreting Platform with Agent Routing](https://webrtc.ventures/successes/remote-video-translation-platform/)
    - [WebRTC to SIP Gateway for ASL Interpreters](https://webrtc.ventures/successes/webrtc-to-sip-gateway-for-asl-interpreters/)
    - [Audio Listening Device to Improve Surgical Outcomes](https://webrtc.ventures/successes/audio-listening-device-to-improve-surgical-outcomes/)
    - [Albania’s First Telemedicine Platform](https://webrtc.ventures/successes/albanias-first-telemedicine-platform/)
    - [Automated Video Storytelling with the Amazon Chime SDK](https://webrtc.ventures/successes/automated-video-storytelling-with-the-amazon-chime-sdk/)
    - [Large Scale Video Conferencing](https://webrtc.ventures/successes/large-scale-video-conferencing/)
    - [Broadcasting and Webcast Control Room](https://webrtc.ventures/successes/live-video-broadcasting-and-webcast-control-room/)
- WebRTC Resources
  
  Show submenu for WebRTC Resources 
  
    - [WebRTC Live](https://webrtc.ventures/webrtc-live/)
    - [WebRTC Tips](https://www.youtube.com/playlist?list=PLayYqdnyegt3QvxX-Rt6wbFIK8727Z5Oz)
    - [WebRTC.ventures Blog](https://webrtc.ventures/blog/)
    - [Migrating From Twilio Video](https://webrtc.ventures/twilio-video/)
    - [WebRTC.ventures Training Program](https://webrtc.ventures/webrtc-ventures-training-program/)
- [About Us](https://webrtc.ventures/our-team/)
  
  Show submenu for About Us 
  
    - [Blog](https://webrtc.ventures/blog/)
    - [Our Team](https://webrtc.ventures/our-team/)
    - [Jobs](https://webrtc.ventures/jobs/)

Open main navigation

Close main navigation

- [WebRTC Services](https://webrtc.ventures/webrtc-development-services/)
  
  Show submenu for WebRTC Services 
  
    - [Assess](https://webrtc.ventures/services/assess/)
    - [Build](https://webrtc.ventures/services/build/)
    - [Integrate](https://webrtc.ventures/services/integrate/)
    - [Test](https://webrtc.ventures/services/test/)
    - [Manage](https://webrtc.ventures/services/manage/)
    - [Migrating From Twilio Video](https://webrtc.ventures/twilio-video/)
- Our Partners
  
  Show submenu for Our Partners 
  
    - [Amazon Chime SDK](https://webrtc.ventures/partners/amazon-chime-sdk/)
- Stories of Success
  
  Show submenu for Stories of Success 
  
    - [Remote Video Interpreting Platform with Agent Routing](https://webrtc.ventures/successes/remote-video-translation-platform/)
    - [WebRTC to SIP Gateway for ASL Interpreters](https://webrtc.ventures/successes/webrtc-to-sip-gateway-for-asl-interpreters/)
    - [Audio Listening Device to Improve Surgical Outcomes](https://webrtc.ventures/successes/audio-listening-device-to-improve-surgical-outcomes/)
    - [Albania’s First Telemedicine Platform](https://webrtc.ventures/successes/albanias-first-telemedicine-platform/)
    - [Automated Video Storytelling with the Amazon Chime SDK](https://webrtc.ventures/successes/automated-video-storytelling-with-the-amazon-chime-sdk/)
    - [Large Scale Video Conferencing](https://webrtc.ventures/successes/large-scale-video-conferencing/)
    - [Broadcasting and Webcast Control Room](https://webrtc.ventures/successes/live-video-broadcasting-and-webcast-control-room/)
- WebRTC Resources
  
  Show submenu for WebRTC Resources 
  
    - [WebRTC Live](https://webrtc.ventures/webrtc-live/)
    - [WebRTC Tips](https://www.youtube.com/playlist?list=PLayYqdnyegt3QvxX-Rt6wbFIK8727Z5Oz)
    - [WebRTC.ventures Blog](https://webrtc.ventures/blog/)
    - [Migrating From Twilio Video](https://webrtc.ventures/twilio-video/)
    - [WebRTC.ventures Training Program](https://webrtc.ventures/webrtc-ventures-training-program/)
- [About Us](https://webrtc.ventures/our-team/)
  
  Show submenu for About Us 
  
    - [Blog](https://webrtc.ventures/blog/)
    - [Our Team](https://webrtc.ventures/our-team/)
    - [Jobs](https://webrtc.ventures/jobs/)
- [Contact us](https://webrtc.ventures/contact/)

[Contact us](https://webrtc.ventures/contact/)

 May 24, 2017 12:00:00 AM

# Tips for iOS & WebRTC Development with TokBox

[ArinSime](https://blog.webrtc.ventures/author/arinsime)

Share: [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://blog.webrtc.ventures/2017/05/ios-webrtc-tokbox) [X Twitter icon](https://twitter.com/intent/tweet?url=https://blog.webrtc.ventures/2017/05/ios-webrtc-tokbox) [envelope icon](mailto:?body=https://blog.webrtc.ventures/2017/05/ios-webrtc-tokbox)

**Facebook Messenger, Hangouts, Slack: Are you familiar with any of these apps? Do you know what they all have in common? The answer is all of them use WebRTC technology for client to client video conversations.** Our team at WebRTC.ventures builds iOS apps like this with WebRTC, and so can you!

**In this blog post we will investigate how to get started building WebRTC into your iOS app.** We will use the native libraries provided by [TokBox](https://tokbox.com/). The code in this article does not represent a complete working application, so I also recommend taking a look at the TokBox team’s reference documentation [Set up a Basic iOS Client (Swift)](https://tokbox.com/developer/tutorials/ios/swift/basic-video-chat/).

![Example of an iOS app built with Tokbox as an example of financial services.](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/soma_tokbox_demo-169x300.jpeg?width=169&height=300&name=soma_tokbox_demo-169x300.jpeg) ![Example of an iOS app built with Tokbox as an example of financial services.](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/soma_tokbox_demo-169x300.jpeg?width=169&height=300&name=soma_tokbox_demo-169x300.jpeg)   
*Example of an iOS app built with Tokbox as an example of [financial services](https://tokbox.com/accelerator-pack/financial-services). In an app like this, you can mix the video communications component with other relevant contextual data.  
 For example, a wealth advisor might want to show you information about your retirement portfolio inside the same secure app where they are communicating with you.*

## Project Configuration

The first thing you’ll need is the TokBox library itself. The library we’re using for this tutorial is maintained by TokBox engineers and published using [Cocoapods](https://cocoapods.org/), from my point of view, the best dependency manager for Swift & Objective-C Cocoa projects. You can quickly get started on a new iOS project with a few simple steps:

`# Install cocoapods in the terminal: sudo gem install cocoapods # Create a podfile in the root directory of your Xcode project: pod init # Add OpenTok to your Podfile: echo "pod 'OpenTok'" > Podfile # Fetch OpenTok and any dependencies: pod install`

On a second step you will need to grant microphone and camera permissions on your iOS app, otherwise you will get several errors during compilation & runtime. Open your Info.plist file and include the following two keys and values:

`Privacy - Camera Usage Description: $(PRODUCT_NAME) uses the camera. Privacy - Microphone Usage Description: $(PRODUCT_NAME) uses the microphone.`

The last step of the configuration phase will be to obtain the authentication credentials and include them on your project as variables. In a production application, these credentials should be generated by a server, but to speed things up we will just hardcode the values for now.

## Sessions (connecting, publishing & subscribing)

Every video chat occurs within a session. You can think of a session as a “room” where clients can interact with one another in real-time. Sessions are hosted on the cloud and manage user connections, audio/video streams and user events.

When the user loads the client-side app will use the session ID and token to establish a connection with the session. On your app you will need to instantiate an OTSession object and call its connect method:

`class ViewController: UIViewController {  var session: OTSession?  func connectToAnOpenTokSession() {   session = OTSession(apiKey: kApiKey, sessionId: kSessionId, delegate: self)   var error: OTError?   session?.connect(withToken: kToken, error: &error)  } }`

Once the app is connected to the session, you will want to publish an audio/video stream using the device camera and microphone. To start streaming you will need to instantiate an OTPublisher object and send it as parameter on the publish method from session:

`class ViewController: UIViewController {  var publisher: OTPublisher?  func sessionDidConnect(_ session: OTSession) {   let settings = OTPublisherSettings()   settings.name = UIDevice.current.name   guard let publisher = OTPublisher(delegate: self, settings: settings) else {    return   }   var error: OTError?   session.publish(publisher, error: &error)  } }`

Finally we want to be able to detect when any other client connects to the session and subscribe to their streams in a session.

`class ViewController: UIViewController {  var subscriber: OTSubscriber?  func session(_ session: OTSession, streamCreated stream: OTStream) {   subscriber = OTSubscriber(stream: stream, delegate: self)   guard let subscriber = subscriber else {    return   }   var error: OTError?   session.subscribe(subscriber, error: &error)  } }`

## New in iOS 10: CallKit

[CallKit](https://developer.apple.com/reference/callkit) is Apple’s library integrated alongside the release of the iOS 10. CallKit allows your app to ring the device as if it were a regular phone call, previously a functionality only allowed to native apps like Phone or FaceTime.

This new library was introduced to solve a common intractable problem: before this release any audio/video call had to be placed and received from within the app, and only when the device is unlocked and the app running on foreground. With this new addition apps can more fully integrate traditional phone experiences into audio/video apps.

To receive incoming calls as regular phone call your app needs to report the incoming call to the global instance of the CXProvider object.

`class ViewController: UIViewController {  let providerConfiguration = CXProviderConfiguration(localizedName: “your app name”)  var provider: CXProvider?  override func viewDidLoad() {   super.viewDidLoad()   provider = CXProvider(configuration: type(of: self).providerConfiguration)  } }`

Allowing native support for traditional phone like features in iOS is a clear signal about the future of mobile communications. Any single developer can make an iOS app nearly indistinguishable from any other communication giant like the Apps we mentioned before.

**As you can see, the integration of WebRTC on iOS is pretty simple and straightforward once you know how they relate to their counterparts.** WebRTC opens up communications to all of us and it enables a lot more than video chat, I have seen industries such as **healthcare**, **education**, **financial services** and many others integrating this technology on their applications.  
 So now… go out there and hop on board!!!

**Are you interested in building an iOS application with Tokbox or WebRTC? [Contact our team](https://webrtc.ventures/contact/) for a quote on how we can build and deploy your application for you! [Our team](https://webrtc.ventures/our-team/) offers complete UX, design, development, testing and deployment services for a variety of industries utilizing video communications.**

[CPaaS](https://blog.webrtc.ventures/tag/cpaas), [Managed Services](https://blog.webrtc.ventures/tag/managed-services), [Events](https://blog.webrtc.ventures/tag/events), [Video Conferencing](https://blog.webrtc.ventures/tag/video-conferencing), [Real Time Weekly](https://blog.webrtc.ventures/tag/real-time-weekly), [WebRTC Architecture](https://blog.webrtc.ventures/tag/webrtc-architecture), [Broadcasting](https://blog.webrtc.ventures/tag/broadcasting), [Medical](https://blog.webrtc.ventures/tag/medical), [WebRTC Live](https://blog.webrtc.ventures/tag/webrtc-live), [Showcase](https://blog.webrtc.ventures/tag/showcase), [Thoughts](https://blog.webrtc.ventures/tag/thoughts), [Vonage](https://blog.webrtc.ventures/tag/vonage), [Daily](https://blog.webrtc.ventures/tag/daily), [Jobs](https://blog.webrtc.ventures/tag/jobs), [Contact Centers](https://blog.webrtc.ventures/tag/contact-centers), [Telehealth](https://blog.webrtc.ventures/tag/telehealth), [Education](https://blog.webrtc.ventures/tag/education), [Technical](https://blog.webrtc.ventures/tag/technical), [General](https://blog.webrtc.ventures/tag/general), [Story of success](https://blog.webrtc.ventures/tag/story-of-success), [The WebRTC.ventures Blog](https://blog.webrtc.ventures/tag/the-webrtc-ventures-blog), [Testing](https://blog.webrtc.ventures/tag/testing), [Gaming](https://blog.webrtc.ventures/tag/gaming), [DevOps](https://blog.webrtc.ventures/tag/devops), [Symbl.ai](https://blog.webrtc.ventures/tag/symbl-ai)

## Related posts

[![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Hiring-a-WebRTC-Developer-Advocate.png?height=200&name=Hiring-a-WebRTC-Developer-Advocate.png)](https://blog.webrtc.ventures/2022/06/hiring-webrtc-developer-advocate)

## [WebRTC.Ventures is Hiring a WebRTC Developer Advocate](https://blog.webrtc.ventures/2022/06/hiring-webrtc-developer-advocate)

![Picture of Jen Oppenheimer](https://blog.webrtc.ventures/hs-fs/hubfs/Our-Team-Jen.jpg?width=50&name=Our-Team-Jen.jpg) [Jen Oppenheimer](https://blog.webrtc.ventures/author/jen-oppenheimer) 

 Jun 29, 2022 12:00:00 AM

WebRTC.ventures, a leading integrator of WebRTC into live video applications, seeks a technical...

[Read more](https://blog.webrtc.ventures/2022/06/hiring-webrtc-developer-advocate)

[![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/IoT_WebRTC_sensors.png?height=200&name=IoT_WebRTC_sensors.png)](https://blog.webrtc.ventures/2015/12/webrtc-and-iot-sensors)

## [WebRTC and IoT Sensors](https://blog.webrtc.ventures/2015/12/webrtc-and-iot-sensors)

[ArinSime](https://blog.webrtc.ventures/author/arinsime) 

 Dec 16, 2015 12:00:00 AM

WebRTC is not just video – it’s Data too! WebRTC is not just about video chat, although that is...

[Read more](https://blog.webrtc.ventures/2015/12/webrtc-and-iot-sensors)

[![](https://blog.webrtc.ventures/hs-fs/hubfs/Imported_Blog_Media/Tiers-of-Managed-Services-To-Support-Your-WebRTC-Application.png?height=200&name=Tiers-of-Managed-Services-To-Support-Your-WebRTC-Application.png)](https://blog.webrtc.ventures/2023/09/tiers-of-managed-services-to-support-your-webrtc-application)

## [Tiers of Managed Services to Support Your WebRTC Application](https://blog.webrtc.ventures/2023/09/tiers-of-managed-services-to-support-your-webrtc-application)

[Rafael Amberths](https://blog.webrtc.ventures/author/rafael-amberths) 

 Sep 27, 2023 12:00:00 AM

In a previous post, Why Your WebRTC App Needs a Managed Service Provider, I discussed the meaning...

[Read more](https://blog.webrtc.ventures/2023/09/tiers-of-managed-services-to-support-your-webrtc-application)

### WebRTC.Ventures Services

...

- Assess
- Build
- Integrate
- Test
- Deploy & Manage

### Contact Us

...

**Video should be an opportunity, not a headache.**   
 We’re here to build, integrate, assess and optimize, test, and even deploy and manage your live video application. 

[Contact us](https://blog.webrtc.ventures/2017/05/ios-webrtc-tokbox#contact)

### WebRTC Live

...

 View [past episodes](https://blog.webrtc.ventures/webrtc-live/) of our webinar interview series about the latest webRTC use cases and technical updates. Join our mailing list to learn about upcoming episodes! 

![WebRTC Live](https://blog.webrtc.ventures/hs-fs/hubfs/Template%20Images/widged-bannet.webp?height=90&name=widged-bannet.webp)

![logo-main-light](https://blog.webrtc.ventures/hubfs/logo-main-light.svg "logo-main-light")

We’re one of the few agencies in the world dedicated to WebRTC development. This dedication and experience is why so many people trust us to help bring live video application dreams to life.

 

### Let's get started!

###### **[Contact us today](https://webrtc.ventures/contact/)**

**[info@webrtc.ventures](mailto:info@webrtc.ventures)**

<https://www.linkedin.com/company/webrtc-ventures> <https://www.youtube.com/@WebrtcVentures>

### Join our mailing list

We don't e-mail often (a few times a month max), and it will be worth it when we do! Of course, we respect your privacy and will not share your contact information.

© 2023 WebRTC.ventures, an [AgilityFeat](https://agilityfeat.com/) company / [Privacy Policy](https://webrtc.ventures/privacy-policy//)

```json
{
  "@context" : "https://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "ArinSime",
    "url" : "https://blog.webrtc.ventures/author/arinsime"
  },
  "dateModified" : "2024-04-03T18:38:36.037Z",
  "datePublished" : "2017-05-24T04:00:00.000Z",
  "headline" : "Tips for iOS & WebRTC Development with TokBox – WebRTC.ventures",
  "image" : [ "https://blog.webrtc.ventures/hubfs/Imported_Blog_Media/iOSDevelopmentTokbox.png" ],
  "mainEntityOfPage" : {
    "@id" : "https://blog.webrtc.ventures/2017/05/ios-webrtc-tokbox",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "url" : "https://blog.webrtc.ventures/hubfs/logo-main-light.svg"
    }
  }
}
```