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

@daiweinpm/cordova-plugin-umengsdk

v3.0.1

Published

友盟统计 9.5.1 友盟性能监控 1.7.0 友盟消息推送 6.5.4

Downloads

26

Readme

说明

友盟统计,友盟性能检测SDK,消息推送,由于隐私政策原因,默认自动收集已改为手动收集,请在适当的时候使用init函数初始化

友盟统计 9.5.1 友盟性能监控 1.7.0 友盟消息推送 6.5.4

安装

npm i @daiweinpm/cordova-plugin-umengsdk
cordova plugin add @daiweinpm/cordova-plugin-umengsdk  --variable APPKEY=YOU_APPKEY
cordova build ios
cordova build android

使用方式


/**
 * 请在代码中引入这一句 或者从window中使用 window.UMSDK
 */
declare const UMSDK;

/**
 * 插件安装失败时此对象可能无法使用 所以需要加入判断
 */
if (UMSDK) {
    /**
    * 注意: 即使您已经在AndroidManifest.xml中配置过appkey和channel值,也需要在App代码中调
    * 用初始化接口(如需要使用AndroidManifest.xml中配置好的appkey和channel值,
    * init调用中appkey和channel参数请置为null,IOS 的参数 deviceType 和 pushSecret 暂不生效。
    * appKey 友盟appkey
    * channelId 渠道ID
    * deviceType 设备类型,1 为手机、2 为盒子,默认为手机
    * pushSecret 推送密钥 Push 推送业务的secret
    */
    UMSDK.init(appKey, channelId, deviceType, pushSecret): Promise<any>;

    /**
     * 打开统计日志模式
     */
    UMSDK.setLogEnabled(isOpen): Promise<any>;

    /**
     * logout 调用后,不再发送账号内容
     * userId 用户ID
     * provider 提供者(可选)
     */
    UMSDK.login(userId, provider): Promise<any>;

    /**
     * logout 调用后,不再发送账号内容
     */
    UMSDK.logout(): Promise<any>;
    
    /**
     * 设置采集模式
     * mode auto = 自动(默认),manual = 手动
     */
    UMSDK.setPageCollectionMode(mode): Promise<any>;
    
    /**
     * 手动采集页面开始
     * 必须配对调用onPageStart:和onPageEnd:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据;
     * 在该页面展示时调用onPageStart:,当退出该页面时调用onPageEnd。
     */
    UMSDK.onPageStart(Pagename): Promise<any>;

    /**
     * 手动采集页面开始
     * 必须配对调用beginLogPageView:和onPageEnd:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据;
     * 在该页面展示时调用beginLogPageView:,当退出该页面时调用onPageEnd。
     */
    UMSDK.onPageEnd(Pagename): Promise<any>;

    /**
     * 事件埋点
     * name 事件名
     * attributes 自定义参数
     */
    UMSDK.onEvent(name, attributes: {}): Promise<any>;

    /**
     * 注册消息推送
     */
    UMSDK.registerPush(): Promise<any>;

    /**
     * 获取设备信息
     * callBack 回调函数
     */
    UMSDK.getDeviceInfo(callBack): Promise<any>;
}