APNS2
To use this library, node must be v6 or higher.
Installation
npm install apns-http2
Create Client
Client using .p12 and passphrase
const APNS = ;const fs = ;const apnsClient = pfx: fs passphrase: 'test' apns_topic: 'com.yourapp.com' production: false;
Client using cert and key in .pem extension
const APNS = ;const fs = ;const apnsClient = cert: fs key: fs apns_topic: 'com.yourapp.com' production: false;
Sending Push Notification
const Notification = APNSNotification; const aps = badge : 9 sound : "bingbong.aiff" ;const alert = title : "Game Request" body : "Bob wants to play poker" ;const deviceToken = '00fc13adff785122b4ad28809a3420982341241421348097878e577c991de8f0';const options = 'aps' : aps 'alert' : alert 'priority' : 10 'expiration' : 0const notification = deviceToken options;apnsClient;