Push Notification For WebRTC Mobile Applications

Introduction

wake-up-callThe mobile push notification is a way to send a message to mobile devices via their services (e.g. Google, Apple, Kindle,…). The message reaches the operating system first through a shared channel between all applications running on the same device.  Then it is forwarded to the target application listener and then the application can react upon this. The application needs to understand the format of the push message.  The mobile needs to be connected to its service (e.g. Google GCM for Android devices, APN for Apple devices, ADM for Kindle devices) so it can receive the push messages on the shared channel. Any successfully authenticated third party server can send the push messages to its applications on the devices via the corresponding service which sends the messages directly to the devices. So the third party server needs to know the type of devices if it wants to support multiple types of devices.

The Google Cloud Messaging (GCM) is the Google mobile free push service for sending data or notification to android devices. Apple Push Notification (APN) is the Apple mobile push service (not free) for sending notifications or data to Apple devices.  In addition to the original push notification, APN supports what is called VOIP push notification where the push notification message has priority over other push notifications so it can reach the device in real time. GCM also supports the priority as a field in the message itself and not as a type of service offered to the customer as APN. So if the GCM push message has high priority, it will reach the device quickly but it costs the device more power. Whereas if it has normal priority, it could not reach the device in real time but this costs less power consumption. In VOIP we have to use high priority when we need to wake up the device to receive a call.

Google now supports APN (I.e. sending push notifications to Apple devices via GCM).  But it is better to talk to those services directly (i.e. talking to APN directly and talking to GCM directly.

Why Push Notification For WebRTC

Usually the WebRTC application needs to have multiple connections to different servers that belongs to the same VOIP service and it is expensive to maintain all those connections. So what can be done is instead of trying to be connected all the time (being online and ready all the time) and consuming the battery life, the VOIP service can push the application to reconnect when it is needed (e.g. on incoming call, on incoming message).

Push Notification For WebRTC Applications

As the signaling protocol is not specified in the WebRTC standard, the push notification support can be added there in the signaling. The WebRTC mobile app gets its push token from its service and sends it via the WebRTC signaling protocol to the WebRTC server. The WebRTC server uses the token as an address to that application within the corresponding push service (e.g. GCM, APN,..). So it formulates the push message in a specific format along with that token/address and sends it to the corresponding push service. The application gets the push notification from its service and then it reacts upon this (e.g. reconnect to get a pending call).