WhoBuilt

Creating a VoIP app in React Native - the beginner's guide

Oct 13, 2021· 30 min· 8.6K views·Watch on YouTube

Speaker

Wojciech Kwiatek, CTO at Challenge, explains how to build a VoIP app in React Native at React Native EU 2021, presented by Callstack.

What a VoIP app needs

VoIP apps such as Zoom, WhatsApp, and Teams connect people over the internet, sometimes without phone numbers. Kwiatek identifies three essentials: access to the microphone or camera, a connection between participants, and a way to show incoming calls through the phone’s native APIs.

Permissions and WebRTC setup

Apps need to handle users denying or revoking microphone access, including by explaining what to do next and keeping the app usable. WebRTC can capture media and connect peers, but the connection requires exchanging session descriptions and ICE candidates through a signaling channel, such as a WebSocket service.

When SIP can help

Kwiatek describes SIP libraries such as JsSIP and SIP.js as abstractions that handle WebRTC signaling and session management. They require a SIP server, with Kamailio and FreeSWITCH as examples. He recommends starting with pure WebRTC to understand the setup, then considering SIP based on the app’s needs.

Handling calls in the background

Mobile apps need to receive calls while in the background. Kwiatek says iOS apps should use VoIP push notifications for incoming calls and report them through CallKit; Android apps can use notifications and ConnectionService. React Native CallKeep supports CallKit and ConnectionService from React Native.

Choosing an implementation path

Kwiatek recaps the need to plan for denied permissions, integrate WebRTC, and decide whether SIP is appropriate for the use case. He also suggests checking whether an existing SDK, such as Twilio, could provide needed VoIP features more cost-effectively than building everything from scratch.

Takeaways

  • Design a useful permission-denied flow and account for users revoking access.
  • Use WebRTC for media connections, and add a signaling channel to exchange session details and ICE candidates.
  • Choose SIP when its signaling and session management fit the product’s needs and server setup.
  • Plan native incoming-call handling: CallKit and VoIP pushes on iOS, ConnectionService and notifications on Android.
  • Compare existing VoIP SDKs with a custom build before committing engineering time.

Mentioned in this talk

Search inside this talk

What was claimed 5

Related talks

Creating a VoIP app in React Native - the beginner's guide, Wojciech Kwiatek · WhoBuilt