Most iOS push notification tutorials either use firebase or rely on 3rd party libraries that are not always up to date. Sometimes there are reasons not to use firebase or 3rd party services/libraries. For instance, when your app is targeted on a single platform or when you don’t want to overload your app with dependencies. So I wanted to put simple instruction to send push on iOS devices through APNs using node.js. Sending push notifications on iOS is very simple. This tutorial demonstrates both certificate based and token based approach to send requests to APNs. Since the steps are guided by APNs protocol, feel free to relate this to any other backed/framework.

Prerequisites

This tutorial assumes that you know steps to integrate push notification service on iOS applications. So I assume you have .p12 certificate or .p8 key file ready. You should also have basic knowledge of node.js or any other javascript framework. Don’t worry if you don’t know node.js/javascript! — you can easily relate this to any other language or framework. I won’t go into node.js details like starting server, routing, blah, blah, blah. This is short and straightforward instruction. I used jsonwebtokento generate token (use any package you like).

  • jsonwebtoken v8.5.1
  • node.js v13.7.0

#nodejs #ios #apn

How to Send Push Notification Through APNs using Node.js
27.60 GEEK