Socket
Socket
Sign inDemoInstall

@appdevshop/push-service-client

Package Overview
Dependencies
51
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appdevshop/push-service-client

Push service client for node.js


Version published
Maintainers
1
0
Install size
5.09 MB

Weekly downloads

Readme

Source

Install

npm i --save @appdevshop/push-service-client

Usage

Import package

import pushService from '@appdevshop/push-service-client'

Initialize client with information about where push-service is running.
After that you can use your pushService everywhere.

pushService.initialize({ host: 'localhost', port: 1343 }) 
Available commands:

You can register firebase token and connect it to some user.

pushService.register(userToken, firebaseToken)

You can unregister firebase token from some user.

pushService.unregister(userToken, firebaseToken)

You can send message to some user, using userToken that was use while registering.

pushService.send(userToken, {
    title: 'push title',
    body: 'push text',
    payload: {
        field: 'all addditional info'
    }
})

userToken - some user identificator, string
firebaseToken - firebase token that was send by user and generated by firebase

Or you can create multiple clients for each service:

const client1 = pushService.createClient({ host: 'localhost', port: 8081 })
const client2 = pushService.createClient({ host: 'localhost', port: 8082 })

NPM
Push-service

Keywords

FAQs

Last updated on 09 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc