Company
Date Published
Author
Devin Rader
Word count
2976
Language
English
Hacker News points
None

Summary

In this series of posts we'll walk through building a Swift version of the Twilio Client's "BasicPhone" application, which allows users to make and receive VoIP calls. We've set up our project in Xcode, added the Twilio Client for iOS SDK, created a bridging header file, and defined a Phone class that interacts with the Twilio Client API's. The Phone class initializes a new virtual phone by generating a capability token from a server-side Node.js application, which is used to initialize an instance of the TCDevice object. We've also added functions to connect to Twilio and start an outbound call using parameters passed from the device to Twilio. With these pieces in place, we've created a simple UI that tests making an outbound call from our Phone class, allowing us to test the functionality of the app. The project showcases great Objective-C/Swift interoperability, with libraries like Twilio Client generally working seamlessly. We'll continue building on this foundation in future posts, adding support for answering incoming calls and notifying users when their phone is ringing even while the app is running in the background.