How to use the jpush-async.JPush.ios 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
export const JiGuangPush = (user_id, message) => {
  client.push().setPlatform('ios', 'android')
    .setAudience(JPush.alias(user_id.toString()))
    .setNotification('双生日记', JPush.ios(message), JPush.android(message, null, 1))
    .setMessage(message)
    .setOptions(null, 60, null, is_Production)
    .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