Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

hinaloe/node-push7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Push7

promised push7 client for node.

simple usage

(for es6)

import {Push7} from 'node-push7'
p7 = new Push7({
    //host:'api.push7.jp',
    appno:'YOUR_PUSH7_APPNO',
    apikey:'YOUR_PUSH7_APIKEY',
    //endpoint:'https://:host/api/v1/:appno/:endpoint',
    //useragent:'Node-Push7 Client/' + version,
})

// get app info
p7.head()
    // domain, icon, name, subscriber count ……etc
    .then(j=>console.log(j)
    // on err
    .catch(err=> console.error(`Error: ${err.name} (${err.message})`))

// push notification
p7.send({
  title:'Push Title',
  body:"Here, main messege",
  icon:"http://example.com/example-image.png", // push icon
  url:'https://push7.jp/', // uri to open when click notification
})
// { success: 'created' }
.then(res=>console.log(res))
// on err
.catch(err=>console.error(`Error: ${err.name} (${err.message})`));

installation

npm install -S node-push7

build

babel

npm run babel

esdoc

npm run esdoc

About

Push7 client for Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published