Meteor-Community-Packages / Meteor-Community-Packages/raix-push

Push.addListener does nothing.

Open
#319 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
JavaScript
Stars
505
Forks
191
PR merge metrics
No merged PRs in 30d

Description

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.');

});`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin at the Meteor.startup setup and the Push.Configure and Push.addListener calls shown in the report; reproduce the missing token and event callbacks on the relevant mobile platform. Trace the registration and listener entry points, then confirm the cause with a focused reproduction or test and document the resulting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.