npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

getui-test1-quickapp

v1.0.1

Published

GeTui push SDK for Quick APP.

Downloads

4

Readme

个推快应用集成文档

安装

NPM

# 目前暂未上线npm
npm install -S @getui-gtsdk-quickapp
npm install

使用

// 目前暂未上线npm
import GtPush from '@getui-gtsdk-quickapp'

//打开调试模式
GtPush.setDebugMode(true)

//初始化推送SDK,生成cid,服务端可通过此cid推送消息到该设备
GtPush.init({

    appid: "123123",

    success: (data) => {

        console.log(`subscribe success, cid: ${data.cid}`)

    },

    fail: (code, msg) => {

        console.log(`subscribe fail, code: ${code}, msg: ${msg}`)

    }

})

//订阅推送消息
GtPush.subscribe({

    callback: (msgId, data) => {

        console.log(`receive msg, msgId: ${msgId}, data: ${data}`)

    }

})

//取消订阅推送消息
GtPush.unscribe()           

API

declare namespace GtPush {
    /**
     * 打开或关闭调试模式
     * @param debugMode 调试模块开启或关闭
     */
    function setDebugMode(debugMode: boolean): void;
    
    /**
     * 订阅push,后续可以收到push消息(一般可在应用初始化的地方进行调用。比如在app的onCreate方法中调用。)
     * @param obj
     */
    function init(obj: {
        /**
         * 个推官网发放的appid
         */
        appid: string;
        /**
         * 订阅成功回调
         */
        success?: (data: {
            /**
             * PushService 返回的注册 id,可用于针对某个用户发送消息
             */
            cid: string;
        }) => void;
        /**
         * 订阅失败回调
         */
        fail?: (
        /**
         * 错误码
         */
        code: number, 
        /**
         * 错误信息
         */
        msg: string) => void;
        /**
         * 执行结束后的回调
         */
        complete?: () => void;
    }): Promise<void>;
    
    /**
    * 订阅push,后续可以收到push消息的事件回调(透传消息的payload内容可在此回调中收到)
    * @param obj
    */
    function subscribe(obj: {
        callback: (data: {
            msgId: string;
            data: string;
        }) => void;
    }): void;
    
    /**
    * 取消订阅push,将移除subscribe添加的push事件回调
    */
    function unsubscribe(): void;
}
export default GtPush;