𝗨𝗻𝗹𝗼𝗰𝗸𝗶𝗻𝗴 𝘁𝗵𝗲 𝗦𝗲𝗰𝗿𝗲𝘁𝘀 𝗼𝗳 𝗣𝘂𝘀𝗵 𝗡𝗼𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻𝘀📲

View on LinkedIn


Ever wondered how those timely notifications magically appear on your mobile device? It's not like you can call an API from your server to someone's mobile device and make a pop-up appear on their phone (that would be somewhat of an adware), neither can you expect the user to have your app run in the background at all times to listen for some event (as in long polling).

These exact questions led me to my journey :

𝘚𝘰, 𝘩𝘰𝘸 𝘥𝘰𝘦𝘴 𝘢 𝘯𝘰𝘵𝘪𝘧𝘪𝘤𝘢𝘵𝘪𝘰𝘯 𝘢𝘱𝘱𝘦𝘢𝘳 𝘪𝘯 𝘳𝘦𝘢𝘭 𝘵𝘪𝘮𝘦?????


Let's dive into the fascinating world of push notifications and their near-real-time delivery:


Push notification services rely on a higher-level identifier, like a device token, ensuring messages find their way to the right recipient. Each device gets a 𝘂𝗻𝗶𝗾𝘂𝗲 𝗶𝗱𝗲𝗻𝘁𝗶𝗳𝗶𝗲𝗿 linked to a specific app instance.


🔗 Registration with Service:


When you install an app with push notifications, it registers with the push service (like firebase's service). The service then ties the device token to the app on that device. It's like a secret handshake between your device and the app!


📡 Server Sends Notification:


When your server has a notification, it sends a request to the push service, including the device token. It's like sending a virtual postcard with a specific address.


🚚 Push Notification Service Routes the Message:


The push service figures out the device's IP address and port for message delivery. This is where a specific operating system push notification service (OSPNS) comes into play.

Then the internets routing system makes sure your message takes the fastest route, i think. It's complex !


📱 Device OS Receives the Push:


The push service talks to your device's operating system. The OS wakes up the right app or process, making sure it's in the loop.


🧠 App Processes the Notification:


Finally, the app gets the notification. And you know the rest, the notification will either just be a message, have some quick actions for you to perform, or redirect you to the app.


Next time you get a push notification, remember the intricate dance of identifiers, registrations, OSPNS, and routing that happens behind the scenes!


So, using a service like Firebase Cloud Messaging (FCM), would abstract exactly these steps from you, which can help you by speeding up the development process for your project, not only being efficient but most importantly, "𝒏𝒐𝒕 𝒓𝒆𝒊𝒏𝒗𝒆𝒏𝒕𝒊𝒏𝒈 𝒕𝒉𝒆 𝒘𝒉𝒆𝒆𝒍".


But maybe you want to, for the sake of it. WHY NOT, I mean? even bypass the limitations of a service, save costs.