How to add VoIP Push Notification to your React Native VoIP App (Part 1)
A few months ago, I was faced with the task of adding the notification of the receiving phone for an incoming call for my React Native VoIP app. In this series of articles, I will discuss the problems I encountered in the implementation, the steps I took to achieve it and some of the lessons I learned in the process.
The Problems Encountered
- Android and iOS both handle the receipt and processing of VoIP notifications in very different ways. This in itself is not a problem but it becomes it needs to be dealt with especially if you require your app to work predictably and reliably.
- I find that iOS will pretty much not call your JavaScript function if the app is closed or the phone is locked. Some Samsung phones and a few other manufacturers will also behave in a like manner.
- Things like heads up notification for Incoming Calls was close to impossible with the React Native Libraries I tried, especially if the phone was locked.
4. You can also expect different behaviors for your app based on the manufacturer and model. Some Samsung phones will not show heads up notification style for your notification. This causes a situation where you have audio playing without a visual element to click on.
5. Properly handling of the lock screen was also an issue.
Given these problems encountered with using a React Native library for this functionality, I decided to implement the solution using native code for both iOS and Android platforms. The next article in this series will show how to properly send a VoIP notification for the call to the receiver.