mhendek
mhendek

Reputation: 273

Node.js - Is there a way to set "apn" module for both production and development purposes?

I am using node-apn module to send push notifications to ios devices. Below you can see my config setting;

apnConfig: {
        providerOptions: {
          token: {
          key: path.join(__dirname, 'keys', 'tokenkey.p8'),
          keyId: 'XXXXX',
          teamId: 'XXXXX'
          },
          production: true  
        },
        topic: 'X.X.X.X'
      },

This config does not work in the development environment. I can not send notifications for testing purposes to development devices. I have to set the "production:" value as "false" to send notification to development. Then I have to change as "true" for sending to production.

In the live environment, I want to use my server both dev and prod purposes. So I can not change the production value always. Is there any way for working with both dev and prod in node-apn module ?

Upvotes: 2

Views: 746

Answers (0)

Related Questions