Meteor: No push notifications are received with the closed app on android

0

I'm starting with Meteor.

I am currently experimenting with the integration with Cordova, specifically with push notifications through the raix plugin: push for Meteor.

The application receives simple push notifications when it is running in the background, although I have not managed to receive photo notifications.

The problem is that when the app is completely closed it is not able to receive notifications, although the server does not notify of any problem.

The application is deployed in Heroku.

%%%%%%%%%%%%%%%%%%%%%%
% mobile-config.js  %%
%%%%%%%%%%%%%%%%%%%%%%

App.configurePlugin('phonegap-plugin-push', {
  SENDER_ID: XXXXXXXXXXX
});


%%%%%%%%%%%%%%%%%%
% client/main.js %
%%%%%%%%%%%%%%%%%%

import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';

import './main.html';

Push.Configure({
 android: {
  senderID: XXXXXXXXXXX,
  alert: true,
  badge: true,
  sound: true,
  vibrate: true,
  clearNotifications: true
  // icon: '',
  // iconColor: ''
 },
});

Template.hello.onCreated(function helloOnCreated() {
 // counter starts at 0
 this.counter = new ReactiveVar(0);
});

Template.hello.helpers({
  counter() {
   return Template.instance().counter.get();
  },
});

Template.hello.events({
 'click button'(event, instance) {
   // increment the counter when button is clicked
   instance.counter.set(instance.counter.get() + 1);
 },

});

%%%%%%%%%%%%%%%%%%
% server/main.js %
%%%%%%%%%%%%%%%%%%

import { Meteor } from 'meteor/meteor';

Meteor.startup(() => {
 // code to run on server at startup

 Push.Configure({
  gcm: {
    apiKey: 'XXXXXXXXXXXXXXXXXXXXXX',
  },
  production: true,
 });

});

Meteor.methods({
 sendPush: function() {
  return Push.send({
   from: 'Test',
      title:'Saludo',
      text:'¡hola mundo!',
      badge: 3,
      query: {},
    });
   },
});

The message is sent through the browser console using

> Meteor.call('sendPush');

The installed versions are the following

// [email protected]
// raix:[email protected]
// [email protected]
// [email protected]

I do not understand what is happening to me and I have been inquiring about it for some time without result, any help will be welcome

    
asked by Phraellyn 07.03.2017 в 15:56
source

0 answers