Comments (8)
having same issue here.
from node-gcm.
This works for me. What exactly are you typing into the console?
from node-gcm.
This is what I get:
$ DEBUG=node-gcm ./node_modules/.bin/mocha -R spec test/**/*Spec.js
UNIT Message
constructor
V should create an empty message with a data object if not passed an object
V should call new on constructor if user does not
V should create an message with properties passed in
V should only set properties passed into constructor
addData()
V should be the same as addDataWithKeyValue
V should add properties to the message data object given a key and value
V should only set values on data object, not top level message
- should do something if not called properly
addDataWithObject()
V should set the data property to the object passed in
V should overwrite data object when an object is passed in
V should not overwrite data if not passed an object
V should not overwrite data if passed an empty object
UNIT Sender
constructor
V should call new on constructor if user does not
V should create a Sender with key and options passed in
- should do something if not passed a valid key
sendNoRetry()
V should set proxy, maxSockets, and/or timeout of req object if passed into constructor
V should set the API key of req object if passed in API key
V should stringify body of req before it is sent
V should set properties of body with message properties
V should set the registration ids to reg ids passed in
V should pass an error into callback if request returns an error
V should pass an error into callback if response does not exist
node-gcm GCM service is unavailable (500) +0ms
V should return the status code as an error if returned a 500
node-gcm Unauthorized (401). Check that your API token is correct. +0ms
V should return the status code as an error if returned a 401
node-gcm Invalid request (400): [object Object] +15ms
V should return the status code as an error if returned a 400
node-gcm Error handling GCM response SyntaxError: Unexpected token o +0ms
V should pass an error into the callback if resBody cannot be parsed
V should pass in parsed resBody into callback on success
send()
- should do something if passed not an array for regIds
node-gcm No RegistrationIds given! +16ms
V should pass an error into callback if array has no regIds
Firing send
V should pass the message and the regId to sendNoRetry on call
Firing send
V should pass the message and the regIds to sendNoRetry on call
Firing send
V should pass the result into callback if successful for id
Firing send
V should pass the result into callback if successful for ids
Firing send
V should pass the error into callback if failure and no retry for id
Firing send
V should pass the error into callback if failure and no retry for ids
Firing send
Firing send
V should retry number of times passed into call and do exponential backoff (1014ms)
Firing send
node-gcm Results received but not all successful +1s { results: [ {}, {}, { error: 'Unavailable' } ] }
Firing send
V should retry if not all regIds were successfully sent (1001ms)
Firing send
Firing send
V should retry all regIds in event of an error (1000ms)
35 passing (3s)
3 pending
Lines like the following are only produced when DEBUG=node-gcm
is set:
node-gcm Unauthorized (401). Check that your API token is correct. +0ms
from node-gcm.
I'm just adding the following line to my code and no new log items are showing.
process.env.DEBUG = 'node-gcm';
from node-gcm.
It works when calling it as shown above, by including the flag in the command you use to run you app.
DEBUG=node-gcm node app.js
I will look into setting the flag in code (and whether this is possible), but I generally wouldn't recommend always running with debug mode on :)
from node-gcm.
(Oops. Accidental close.)
from node-gcm.
It should probably be clarified in the README how to actually use the DEBUG flag
from node-gcm.
The issue of setting the flag programatically should probably be taken over to the debug repository's issues.
from node-gcm.
Related Issues (20)
- Address deprecation of request package HOT 2
- How to add analytics label to message? HOT 5
- Unable to send push to browser(firefox, chrome) always getting InvalidRegistration HOT 4
- Make send URI configurable HOT 1
- fcm_options and analytics_label fields are not sent to FCM servers? HOT 2
- TypeError: Cannot read property 'error' of undefined failed_tokens example HOT 1
- Not receiving notifications - ios HOT 2
- Add snyk to fix vulnerabilities faster HOT 15
- Add missing GitHub releases and version tags
- Add CI to require passing tests before release HOT 2
- didReceiveRemoteNotification:fetchCompletionHandler not called. HOT 6
- readme error in failedTokens snippets HOT 1
- Removing no longer valid FCM tokens HOT 1
- Add release automation HOT 2
- Support for Google Service Accounts authorization HOT 2
- Firebase Legacy HTTP API discontinued by June 20, 2024 HOT 12
- request package security issue. HOT 3
- Handle non-HTTP errors HOT 1
- Handle all HTTP errors
- Migration from legacy FCM to HTTP v1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-gcm.