var feedbackOptions = {
'batchFeedback': true,
// Time in SECONDS
'interval': 5,
production: !options.apn.development,
cert: options.certData,
key: options.keyData,
passphrase: options.passphrase
};
var feedback = new apn.Feedback(feedbackOptions);
So it should be:
var feedbackOptions = {
'batchFeedback': true,
// Time in SECONDS
'interval': 5,
production: !options.apn.development,
cert: options.apn.certData,
key: options.apn.keyData,
passphrase: options.passphrase
};
var feedback = new apn.Feedback(feedbackOptions);
Making this change fixes the configuration. However, once configured properly an additional downstream error is thrown. The on 'feedback' callback function is not bound to the meteor environment.
Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.
feedback.on('feedback', function (devices) {
devices.forEach(function (item) {
// Do something with item.device and item.time;
// console.log('A:PUSH FEEDBACK ' + item.device + ' - ' + item.time);
// The app is most likely removed from the device, we should
// remove the token
_removeToken({
apn: item.device
});
});
});
Affected Version: 3.3.0
The configuration of the Feedback Service does not work with documented raix config. certData and keyData are nested under options.apn.certData and options.apn.keyData. https://github.com/raix/push/blob/v3.3.0/lib/server/push.api.js#L242
So it should be:
Making this change fixes the configuration. However, once configured properly an additional downstream error is thrown. The on 'feedback' callback function is not bound to the meteor environment.
https://github.com/raix/push/blob/v3.3.0/lib/server/push.api.js#L254