Raix:push No clients have registered on the server yet

Hi
I try to add push notifications for my app and added raix:push. Unfortunately I got stuck in an error. I cannot register a device. Wether Android nor iOS. When starting meteor on my local machine following output appears:

=> Started proxy.
I20160406-21:38:18.528(2)? Push.Configure { apn:
I20160406-21:38:18.529(2)? { keyData: … },
I20160406-21:38:18.529(2)? gcm: { apiKey: …},
I20160406-21:38:18.530(2)? production: false,
I20160406-21:38:18.530(2)? sound: true,
I20160406-21:38:18.530(2)? badge: true,
I20160406-21:38:18.530(2)? alert: true,
I20160406-21:38:18.530(2)? vibrate: true }
I20160406-21:38:18.530(2)? Push: APN configured
W20160406-21:38:18.531(2)? (STDERR) WARNING: Push APN is in development mode
I20160406-21:38:18.654(2)? GCM configured
=> Started your app.
=> App running at: http://localhost:3000/
I20160406-21:38:36.620(2)? Push: Settings userId “oaSEiGfrdcjzmJ7P9” for app: zB3L5mm9P3icCo9rJ
I20160406-21:42:40.461(2)? Push: Settings userId “oaSEiGfrdcjzmJ7P9” for app: DcfSFow64uB6wKYbg

How I am calling from Chrome console:

Push.send({
from: ‘Test’,
title: ‘Hello’,
text: ‘World’,
badge: 12,
query: {}
});

And from meteor server I get the following output:

I20160406-21:43:06.256(2)? Push: Send message “Hello” via query {}
I20160406-21:43:06.374(2)? Push: Sent message “Hello” to 0 ios apps 0 android apps
I20160406-21:43:06.493(2)? Push, GUIDE: The “Push.appCollection” is empty - No clients have registred on the server yet…

I have set-up:

  • Apple APN (certificate etc.)
  • Google API key
  • config.push.json in my app (in root folder)
  • Push methods on server (see below)
  • Added listener on client on Meteor.startup (see below)

server/lib/pushMethods.js:

Push.debug = true;

Push.allow({
send: function(userId, notification) {
return true; // Allow all users to send
}
});

Meteor.methods({
serverNotification: function(text,title) {
var badge = 1;
Push.send({
from: ‘push’,
title: title,
text: text,
badge: badge,
payload: {
title: title,
text:text
},
query: {
// this will send to all users
}
});
},
userNotification: function(text,title,userId) {
var badge = 1;
Push.send({
from: ‘push’,
title: title,
text: text,
badge: badge,
payload: {
title: title
},
query: {
userId: userId //this will send to a specific Meteor.user()._id
}
});
},
removeHistory: function() {
NotificationHistory.remove({}, function(error) {
if (!error) {
console.log(“All history removed”);
}
});
}
});

client/lib/startup.js:

Meteor.startup(function () {
Push.addListener(‘token’, function(token) {
alert(JSON.stringify(token));
Meteor.call(‘raix:push-update’, token, function(err, result){
if (err) {
alert("ERROR: I am inside raix:push-update call " +err);
} else {
alert("Succesfully added: " + result)
}
});
});

Push.addListener('message', function(notification) {
    alert("message");
});
...
//some other geolocation stuff follows, which is working, that's why I know the startup.js is executed.
...

However, it seems that the code in startup on the client is never called (the listeners). Because they should display an alert. I also had a look at logcat from Android too see if anything here is executed on startup but its not.
EDIT: I also deployed my app to AWS, to see if there is a local problem (somewhere I read that push notifications is not working on local server…) I get the same error message as above (No clients have registred on the server yet…) I tried also to call again from Chrome console of my AWS deployed app:

Meteor.call(“serverNotification”, “text”, “title”)

Output:

undefined

I looked at the following solutions on GitHub, but no success so far:



Any ideas? Or did I forgot anything to configure? How can I register a device? Or a problem with Meteor 1.3?

3 Likes

Hi, I’ve been stuck with the same issue for a few days now as well. Not sure how to get past.

I just tried a downgrade to 1.2.1 and same thing though, so didn’t seem to be a 1.3 problem. I can’t be sure where the problem is though.

Any help would be appreciated.

I’m also having the same problem. I no longer receive a token on Android after upgrading. Prior to this push notifications were working as expected.

I’ve tried downgrading back to 1.2.1 but still to not receive a token nor do I receive a token if i revert to prior working versions of my project. I am receiving a token on IOS however.

I’ve tried adding meteor add cordova:cordova-plugin-device@1.1.1 which hasn’t helped and also tried downgrading raix:push to 2.6.12 as suggested here: https://github.com/raix/push/issues/201

I’ve also tried creating a new API key for GCM in the developers console.

Any ideas/suggestions would be really helpful, no matter how far-fetched.

1 Like

@nickoj : Same here - will try to downgrade raix:push to 2.6.12, maybe 3.0.2 is producing this issue

Anybody here who could give a brief summary of what one has to do to make raix:push work?
Is the use of a config.push.json deprecated (in which version?). So how would a call of Push.configure look like and where should we put it (client/server, startup)?

I had the same issue. The fix for me was to generate new certificate for iOS.

I create a gist with my settings https://gist.github.com/costinelmarin/093de1eabc7047fea5998b4394ea84e1.

Also try running the app using meteor run ios-device --mobile-server IP.xxx.x.x:3000

Apparently this could’ve been caused by various things being done wrong, and the feedback here isn’t very good.

Anyways what fixed it for me was adding some cordova plugins:

de.appplant.cordova.plugin.local-notification@0.8.4
org.apache.cordova.dialogs@1.2.1
org.apache.cordova.vibration@2.1.1

Just copy/paste that in .meteor/cordova-plugins, that was turning point fix for me.

1 Like

Yep, this really works!!! Thanks @lytstephen

For me just

meteor add cordova:cordova-plugin-device@1.1.3

worked!

1 Like

Same here adding cordova:cordova-plugin-device@1.1.5 did it for me