Meteor-Community-Packages / raix-push

DEPRECATED: Push notifications for cordova (ios, android) browser (Chrome, Safari, Firefox)
https://atmospherejs.com/raix/push
MIT License
513 stars 197 forks source link

UserId is "null" on token #212

Closed ouya99 closed 8 years ago

ouya99 commented 8 years ago

Hi,

i am using raix:push_3.0.2_r2 and meteor 1.3. Currently I am having problems to register with a user and create a token (Android and Web). How would you guarantee that userId is not null. Do not understand where this null setting is coming from. I do have a meteor.userId which is given by oauth login

Could it be that the userId is given at startup, when I call Push.Configure.. At that point in time there is no user present. Also do I ever need to call Push.enabled(true) ? Is Push.Configure sufficient? (and Push.Send afterwards)

Here my server collection...

db.getCollection('_raix_push_app_tokens').find() { "_id" : "ycQzNMyvKX4jS5RoP", "appName" : "main", "userId" : null, "enabled" : true, "createdAt" : ISODate("2016-05-07T08:25:04.541Z"), "updatedAt" : ISODate("2016-05-07T08:55:51.374Z") }

Thank you for your help java99

ouya99 commented 8 years ago

So it all worked out !

Just to help out everybody having issues like not getting push notifications any more.

  1. Check https://github.com/raix/push/issues/201

Then try to call Push.configure after your user-login. not in startup or anywhere before having a userId

In case you see debug messages like "0 ios, 0 android devices connected" check on the server whether there is a collection for raix tokens.