@tng/soa-node-tpush
v0.0.2
Published
soa tpush node client
Downloads
4
Readme
SOA-TPUSH for Node
安装
yarn add @tng/soa-node-tpush
使用
const SOATpush = require('@tng/soa-node-tpush')
const TWSAuth = require('tws-auth')
const Teambition = require('teambition')
// use tws-auth
let twsAuth = new TWSAuth({ ... })
let soatracker = new SOAOrg({ twsAuth: twsAuth })
// use teambition
let teambition = new Teambition({ ... })
let soatracker = new SOATpush({ teambition: teambition })
// create a track
let track = await soatracker.v1().tracks().create({
"deviceToken": "xxx",
"message": {
"data": {
"additionalProp1": {},
"additionalProp2": {},
"additionalProp3": {}
},
"ios": {
"badge": 0,
"category": "xxx"
},
"mipush": {
"description": "xxx",
"extra": {
"additionalProp1": "xx",
"additionalProp2": "xx",
"additionalProp3": "xxx"
}
},
"notification": {
"body": "xxx",
"sound": "xxx",
"title": "xxx"
},
"timeToLive": 0,
"xgpush": {
"builder_id": 0
}
},
"platform": "xxx",
"system_version": "xxx"
})
// query tracks
let track = await soatracker.appconfig().list()
测试
npm test