SimpleRTApp: Using APN to Send iOS Pushes From a Node.js API

Federico Jordán
The Startup
Published in
7 min readSep 7, 2020

--

This article is also available on my personal blog

This article is part of a series that aims to build a system to send notifications of relevant articles of Twitter, with the purpose of being easily retweeted. Here is the complete article.

In this opportunity, we’re going to see how to send push notifications from a Node.js API to an iOS device. To do that, we’re going to use the apn node package.

Requirements

To continue with the article, we’ll need to have the following:

  • a physical iOS device, that’s because pushes don’t work on simulator
  • an Apple Developer Program Membership account. We know that we can build the app on device without it, but to be able to setup the push notifications we would need to have one, in order to create a Push Notification Certificate.

Apple Push Notification Service

Apple Push Notification service (APNs) is the main actor in remote notifications feature. It’s a remote, robust and secure service which allows developers send information to iOS (and also indirectly to watchOS), tvOS and macOS devices.

When an iOS app starts on a device, the system automatically establishes an accredited, encrypted and persistent IP connection between the app and APNs. This connection allows the app to setup and enable the device to receive notifications. You can read…

--

--