# umeng-push-server-sdk

> Umeng Push Server SDK for Nodejs

Latest version **0.0.3** (published 2018-07-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install umeng-push-server-sdk
pnpm add umeng-push-server-sdk
yarn add umeng-push-server-sdk
bun add umeng-push-server-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-07-23 |
| First published | 2017-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4 |
| Dependencies | 5 |
| Unpacked size | 63.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | LnsooXD |
| Maintainers | lnsoo |
| Keywords | umeng, push, umeng push, umeng push sdk, u push, u push sdk |

## Links

- npm: https://www.npmjs.com/package/umeng-push-server-sdk
- Repository: https://github.com/LnsooXD/umeng-push-server-sdk
- Homepage: https://github.com/LnsooXD/umeng-push-server-sdk#readme
- Issues: https://github.com/LnsooXD/umeng-push-server-sdk/issues
- npm.io page: https://npm.io/package/umeng-push-server-sdk

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^3.1.0
- [request](https://npm.io/package/request.md) ^2.87.0
- [@types/node](https://npm.io/package/@types/node.md) ^10.5.2
- [@types/request](https://npm.io/package/@types/request.md) ^2.47.1
- [callback-promise-union](https://npm.io/package/callback-promise-union.md) ^1.0.1

## Recent versions

- 0.0.3 (latest) — 2018-07-23
- 0.0.2 — 2017-03-24
- 0.0.1 — 2017-03-24

## README

# Umeng Push Server SDK for NodeJs

## Installation

```sh
npm i -S meng-push-server-sdk
```

## Usage

> Android

```javascript
const push = require('umeng-push-server-sdk');
const client = new push.client();
const AndroidUnicast = push.android.unicast;
const AndroidNotification = push.android.base;

const appKey = 'xxxxxx';
const appMasterSecret = 'xxxxx';

const unicast = new AndroidUnicast(appKey, appMasterSecret);
// Set your device token
unicast.setDeviceToken("your device token");
unicast.setTicker("Android unicast ticker");
unicast.setTitle("中文的title");
unicast.setText("Android unicast text");
unicast.goAppAfterOpen();
unicast.setDisplayType(AndroidNotification.DisplayType.NOTIFICATION);
// Set 'production_mode' to 'false' if it's a test device.
// For how to register a test device, please see the developer doc.
unicast.setProductionMode();
// Set customized fields
unicast.setExtraField("test", "helloworld");
// Set Huawei Xiaomi Flyme Notify
unicast.setMipush(true);
unicast.setMi_activity('com.umeng.message.example.MipushTestActivity');

client.send(unicast);
```

> IOS

```javascript
const push = require('umeng-push-server-sdk');
const client = new push.client();
const IOSUnicast = push.ios.unicast;

const appKey = 'xxx';
const appMasterSecret = 'xxx';

const unicast = new IOSUnicast(appKey, appMasterSecret);
// Set your device token
unicast.setDeviceToken("Your device token");
unicast.setAlert("IOS unicast");
unicast.setBadge(0);
unicast.setSound("default");
// set 'production_mode' to 'true' if your app is under production mode
unicast.setProductionMode();
// Set customized fields
unicast.setCustomizedField("test", "helloworld");
client.send(unicast);
```

> For a full-fearture demo, see [Demo.ts](https://github.com/LnsooXD/umeng-push-server-sdk/blob/master/examples/Demo.ts) and [RunDemo.ts](https://github.com/LnsooXD/umeng-push-server-sdk/blob/master/examples/RunDemo.ts)

## Author

- [LnsooXD](https://github.com/LnsooXD)

## Contributors

- [LnsooXD](https://github.com/LnsooXD)
- [ZhichengChen](https://github.com/ZhichengChen)

## License

- [MIT](http://spdx.org/licenses/MIT)

---
_Source: https://npm.io/package/umeng-push-server-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
