The following code is written, however no response is received from any of the Push.addListener. Meteor.call('systemconsolelog') simply prints a message on the server console, as this is a production app I have not used alert() to avoid confusing users. However alert() does not do anything either. Has anyone had a similar issue?
I am trying to get the tokens to be reported and have followed the tutorial, but cannot get tokens to be received & stored.
Push.addListener('register', function(evt) {
// Platform specific event - not really used
var message = 'register: ' + JSON.stringify(evt);
Meteor.call('systemconsolelog',message);
});
Push.addListener('alert', function(notification) {
// Called when message got a message in forground
var message = 'alert: ' + JSON.stringify(notification);
Meteor.call('systemconsolelog',message);
});
Push.addListener('sound', function(notification) {
// Called when message got a sound
var message = 'sound: ' + JSON.stringify(notification);
Meteor.call('systemconsolelog',message);
});
Push.addListener('badge', function(notification) {
// Called when message got a badge
var message = 'badge: ' + JSON.stringify(notification);
Meteor.call('systemconsolelog',message);
});
Push.addListener('startup', function(notification) {
// Called when message recieved on startup (cold+warm)
var message = 'startup: ' + JSON.stringify(notification);
Meteor.call('systemconsolelog',message);
});
Push.addListener('message', function(notification) {
// Called on every message
var message = 'message: ' + JSON.stringify(notification);
Meteor.call('systemconsolelog',message);
});
The following code is written, however no response is received from any of the Push.addListener. Meteor.call('systemconsolelog') simply prints a message on the server console, as this is a production app I have not used alert() to avoid confusing users. However alert() does not do anything either. Has anyone had a similar issue?
I am trying to get the tokens to be reported and have followed the tutorial, but cannot get tokens to be received & stored.
`Meteor.startup(function () {
Push.Configure({ appName: 'Custom Name', android: { senderID: XXXXXXXXXXXXX, alert: true, badge: true, sound: true, vibrate: true, clearNotifications: false, icon: 'pushicon', iconColor: '#edd759' }, ios: { alert: true, badge: true, sound: true } });
// Internal events Push.addListener('token', function(token) { var message = 'token: ' + JSON.stringify(token); Meteor.call('systemconsolelog',message); });
Push.addListener('error', function(err) { var message = 'error: ' + JSON.stringify(err); Meteor.call('systemconsolelog',message); });
Push.addListener('register', function(evt) { // Platform specific event - not really used var message = 'register: ' + JSON.stringify(evt); Meteor.call('systemconsolelog',message); });
Push.addListener('alert', function(notification) { // Called when message got a message in forground var message = 'alert: ' + JSON.stringify(notification); Meteor.call('systemconsolelog',message); });
Push.addListener('sound', function(notification) { // Called when message got a sound var message = 'sound: ' + JSON.stringify(notification); Meteor.call('systemconsolelog',message); });
Push.addListener('badge', function(notification) { // Called when message got a badge var message = 'badge: ' + JSON.stringify(notification); Meteor.call('systemconsolelog',message); });
Push.addListener('startup', function(notification) { // Called when message recieved on startup (cold+warm) var message = 'startup: ' + JSON.stringify(notification); Meteor.call('systemconsolelog',message); });
Push.addListener('message', function(notification) { // Called on every message var message = 'message: ' + JSON.stringify(notification); Meteor.call('systemconsolelog',message); });
Meteor.call('systemconsolelog','tried everything.');
});`