iOS Push Notifications with NodeJS - credentials

1.7k views Asked by At

I have a requirement to implement the server side code for pushing notifications to an iOS app. I have followed this link.

The problem is I always get 'Insufficient credentials' message. I am using the apnagent node module.

Has anyone tried this successfully? Is there something additional I should do to set my credentials?

Thanks in advance.

1

There are 1 answers

0
martypdx On

Yes, I just got apnagent running. Assuming you set up your certificate and app correctly, I got it to work with either:

  • certificate.p12 and passphrase, or
  • cert.pem and key.pem files

That is:

agent
    .set('cert file', join(__dirname, '../_cert/apn-dev-cert.pem'))
    .set('key file', join(__dirname, '../_cert/apn-dev-key.pem'))
    //or this works too:
    // .set('pfx file', join(__dirname, '../_cert/Certificates.p12'))
    // .set('passphrase', 'your passphrase')
    .enable('sandbox')