1

I want to send push-notifications to iphone by using node.js server-side language I found npm two modules for doing that

  1. https://www.npmjs.com/package/apns

    var apns = require("apns"), options, connection, notification;
    
    options = {
     keyFile : "conf/key.pem",
     certFile : "conf/cert.pem",
     debug : true
    };
    

    connection = new apns.Connection(options);

I have only single pem file but they are asking about two pem files key.pem and cert.pem

  1. https://www.npmjs.com/package/apn

      var options = {
        token: {
         key: "path/to/key.p8",
         keyId: "T0K3NK3Y1D",
         teamId: "T34M1D"
      },
      production: false
     };
    
    var apnProvider = new apn.Provider(options);
    

In this, they are asking about key, keyId. teamId. But how can I get this ?

Which npm module should I used for sending Apple push notifications ?

I have pem file and bundle id of my app. Are they sufficient to send push notifications to Apple user or not ?

Also can't figure out which npm module is best suited for sending the same ? Any suggestions are always welcome regarding this.

Thanks for the help

VIKAS KOHLI
  • 8,164
  • 4
  • 50
  • 61
  • How to generate key.pem and cert.pem file? Did you get any solution? I am facing the same issue – Ishika Dec 15 '17 at 05:26
  • @ishika Yes I got the solution. I used the apns module and the pem files generated by the IOS team. Actually the path I used for pem files is wrong that's why unable to send notification in ios – VIKAS KOHLI Dec 15 '17 at 06:57

1 Answers1

0

You have too many subquestions in that question which point to the same question of which npm module to use for sending iOS notifications from node server.

I used APN module from here and it works seamlessly- https://www.npmjs.com/package/apn

Apple guide on how APN works- https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW1

Details on how to create key and certificate files- https://quickblox.com/developers/How_to_create_APNS_certificates

Hope that helps!

Rohan Rayarikar
  • 240
  • 2
  • 6