Closed dozel closed 6 years ago
I'm getting an empty error.
I just put "production: false" in the apn options and it worked in production as well. So why would I be running into this issue when production is true?
Hi @dozel.
Can you share your entire configuration?
@alex-friedl sure!
const PushNotifications = require('node-pushnotifications');
const pushKey = './dir/to/AUTHKEY.p8';
const firebaseKey = 'FIREBASE_KEY';
const keyId = 'APPLE_KEY_ID';
const teamId = 'APPLE_TEAM_ID';
const topic = 'com.app.topic';
const settings = {
gcm: {
id: firebaseKey,
},
apn: {
token: {
key: pushKey,
keyId,
teamId,
},
},
};
const push = new PushNotifications(settings);
module.exports = {
send(deviceIds, { title, body }, cb) {
const data = {
topic,
title,
body,
};
return push.send(deviceIds, data, cb);
},
};
The issue was with my ios build. I had to re-create the push certificates and had to re-build. All is good now.
I'm using the apns key (.p8 file) and I thought it worked for both development and production environments. I'm also using GCM, and android pushes work just fine in both environments.
Would there be a reason why APNs would not work in production? Maybe I'm missing a step or two.
Any help would be greatly appreciated. Thanks!