Simple example on how to deliver iOS Push Notifications with Node.js.
This code sample shows how to create a web provider for your push notifications which interfaces with the Apple Push Notification Service (APNS) using Node.js and the amazing node-apn module.
The sample was originally used in this workshop.
git clone https://github.com/bepid-ifce/push_notifications-node.git
- Enter the repo directory:
cd push_notifications-node
- Install all dependencies:
npm install
-
Add your
cert.pem
andkey.pem
files to the project root - you can find more info on this here -
Add at least one device token here
-
Uncomment the function calls you want to test in the
index.js
:
...
connect(service);
same(service, tokens); // Uncomment this line to push the same notifications to each device from devices.json
different(service, tokens); // Uncomment this line to push different notifications to each device from devices.json
If you're still confused with all the process of push notifications to iOS, you can find a pretty good tutorial here and a good help on how to generate your certicates here.
Nothing of this would be possible without the amazing node-apn module.
Push Notifications Node.js is distributed under the MIT License, available in this repository. All contributions are assumed to be also licensed under the MIT License.