appfeel / node-pushnotifications

Push notifications for GCM, APNS, MPNS, AMZ (automatic detection from device token)
MIT License
544 stars 125 forks source link

getting error #3

Closed charithvalluru closed 8 years ago

charithvalluru commented 8 years ago

I am getting this error: "Cannot read property 'sendPush' of undefined".

Request you to please help me out in this.

CookieCookson commented 8 years ago

I'm getting the same error here!

CookieCookson commented 8 years ago

Fixed it by doing:

var settings = {...}
var pushnotifications = require('node-pushnotifications');
var push = new pushnotifications(settings);
push.send(...);
miqmago commented 8 years ago

Thanks @CookieCookson , does this work for you @charithvalluru ? Reopen issue with your code in contrary case.

miqmago commented 8 years ago

Please note also that there was a bug that has been solved https://github.com/appfeel/node-pushnotifications/pull/2 so you should update to 0.1.5:

$ npm i node-pushnotifications
$ npm i node-pushnotifications@0.1.5       # if you are using npm with target versions