A push message’s path, from being sent from an application’s provider to being delivered to the intended audience, can be described in a few general steps for both web and iOS applications. In both cases, the key elements involved in passing a push message to the target devices as a notification include:

  1. Service Provider: Your web or iOS application that initiates a push message to be delivered to target users is the service provider. Along with the push message, the request must contain the information that is necessary for a push service to route the message to the right client and to wake up the right service worker.
  2. Server: The server makes the API call to the push service to request the delivery of a push message. In this case, Catalyst provides the servers that are required to handle all backend activities. API calls to a push service can only be made after Catalyst is configured with it.
  3. Push Service: For web applications, each browser like Chrome and Firefox implements its own push service. The Safari browser and iOS applications implement APNs.

    The push service is responsible for validating a push message, waking up the right service worker and routing your message to the targeted devices as notifications. In the case of a web application, the push service also queues your push message until a target device is available to receive it.
  4. Service Worker: A service worker is a JavaScript file that is idle and listens for a push event to occur. When the push message is routed to a particular device by the push service, the service worker assigned to that device briefly awakens and displays the message as a notification.

    It follows the constraints as defined in the notification API and displays the notification to the user accordingly. The service worker handles the user’s interaction with the push notification. Once the interaction is done, the service worker becomes idle again. Catalyst handles the implementation of the service workers for various web browsers and iOS.

This entire process occupies only a brief amount of time as the push messages that you initiate are delivered to the user devices within seconds, provided all conditions are met.

For the web platform, Catalyst sends a Push API call to the push service to request the delivery of a push message.

For the iOS platform, the process also involves a device token that is globally unique and identifies one app-device combination. Every time a user device launches your app, it sends a request to establish a connection with APNs. Once this is established successfully, the device token is provided to the device by APNs. This establishes the channel between your app and the device. You can learn about this process in detail from the official developer documentation of Apple.

Last Updated 2023-05-08 18:05:05 +0530 +0530