GithubHelp home page GithubHelp logo

Comments (8)

rahatm1 avatar rahatm1 commented on July 3, 2024

having same issue here.

from node-gcm.

hypesystem avatar hypesystem commented on July 3, 2024

This works for me. What exactly are you typing into the console?

from node-gcm.

hypesystem avatar hypesystem commented on July 3, 2024

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.

bigthyme avatar bigthyme commented on July 3, 2024

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.

hypesystem avatar hypesystem commented on July 3, 2024

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.

hypesystem avatar hypesystem commented on July 3, 2024

(Oops. Accidental close.)

from node-gcm.

hypesystem avatar hypesystem commented on July 3, 2024

It should probably be clarified in the README how to actually use the DEBUG flag

from node-gcm.

hypesystem avatar hypesystem commented on July 3, 2024

The issue of setting the flag programatically should probably be taken over to the debug repository's issues.

from node-gcm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.