How to use the jpush-async.JPush.APIConnectionError function in jpush-async

To help you get started, we’ve selected a few jpush-async examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airingursb / 2life-server / src / config / index.js View on Github external
.send(function (err, res) {
      if (err) {
        if (err instanceof JPush.APIConnectionError) {
          console.log(err.message)
          // Response Timeout means your request to the server may have already received,
          // please check whether or not to push
          console.log(err.isResponseTimeout)
        } else if (err instanceof JPush.APIRequestError) {
          console.log(err.message)
        }
      } else {
        console.log('Sendno: ' + res.sendno)
        console.log('Msg_id: ' + res.msg_id)
      }
    })
}

jpush-async

JPush's officially supported Node.js client library.

GPL-2.0
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis