New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

getui-rest-sdk

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getui-rest-sdk

Getui rest api for node.js, in TypeScript

  • 0.0.1-alpha1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

Getui Rest SDK

Getting Started

详细原接口文档:http://docs.getui.com/server/rest/start/

Warning: 未经严格测试,尚未正式发布

Installing

npm i getui-rest-sdk --save

Usage

单推

import Getui, {
  GetuiOption,
  ApnsInfo,
  Alert,
  SingleMessage,
  Target,
  TransmissionTemplate,
} from 'getui-rest-sdk'

(async () => {
  const option: GetuiOption = {
    appId: 'appId',
    appSecret: 'appSecret',
    appKey: 'appKey',
    masterSecret: 'masterSecret',
  };

  const gt: Getui = new Getui(option);

  await gt.authSign();

  // Init the apnsinfo
  const alert = new Alert();
  alert.title = 'This is a push test';
  alert.body = 'single push';

  const apnsInfo = new ApnsInfo();
  apnsInfo.alert = alert;

  // Init template
  const template = new TransmissionTemplate();
  template.transmissionContent = JSON.stringify({
    data: '123',
  });

  // Assign apnsinfo and template to the message
  const message = new SingleMessage();
  message.apnsInfo = apnsInfo;
  message.template = template;

  const target = new Target();
  target.cid = 'example-cid';

  const ret = await gt.pushMessageToSingle(message, target);
  console.log(ret);

  await gt.authClose();
});

TODO

  • 其它接口
  • 测试代码完善

License

This project is licensed under the MIT License - see the LICENSE file for details

Keywords

FAQs

Package last updated on 21 Dec 2017

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