Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@appdevshop/push-service-client

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appdevshop/push-service-client

Push service client for node.js

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 09 Aug 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc