1.2.15 • Published 2 years ago

push-notifications-coinstats v1.2.15

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

CoinStats Push-notifications

Web Twitter URL

an universal library used to send push notifications to ios,android and web.

Install

npm install push-notifications-coinstats

Usage

Create a push folder in the root of your project:

  1. Add production.p12 certificate( you can add also development.p12 certificate if you want to send dev push notifications)
  2. Add iosConfig.json in this form
   {
  "production": {
    "appName": "Coin Stats",
    "push": {
      "ios": [
        {
          "pfx": "",
          "bundleId": "some boundle id",
          "production": true,
          "passphrase": "passphrase"
        }
      ]
    },
    "logLevel": "warn"
  },
  "development": {
    "appName": "Coin Stats",
    "push": {
      "ios": [
        {
          "pfx": "",
          "bundleId": "bundleId",
          "production": false,
          "passphrase": "passphrase"
        }
      ]
    },
    "logLevel": "warn"
  }
}
  1. Import in existing project
const {PushNotification} = require('push-notifications-coinstats')
const pushService = new PushNotification(
    process.env.PUSH_ANDROID_API_KEY, // Android key
    { // Ios Config
        production: require('./iosConfig.json').production,
        development: require('./iosConfig.json').development,
        dirname: __dirname
    },
    process.env.PUSH_ONESIGNAL_ID) // One signal 
  1. Use pushService to send push notifications
pushService.sendPushToAndroidDevices(data, tokens);

Note: use options to add optional data to your push notification.

1.2.8

2 years ago

1.2.7

2 years ago

1.2.9

2 years ago

1.2.12

2 years ago

1.2.13

2 years ago

1.2.10

2 years ago

1.2.11

2 years ago

1.2.15

2 years ago

1.2.6

3 years ago

1.2.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.2.5

3 years ago

1.1.6

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.10

3 years ago

1.1.5

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago