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

cordova-plugin-baidumobilestatics

v1.0.0

Published

a cordova plugin, a JS version of baidu-mob-statistics

Downloads

2

Readme

2019.03.28更新说明

iOS SDK更新为v4.9.5 libstdc++.tbd更新为libc++.tbd,适配xcode 10

前言:

百度移动统计官方有提供cordova插件,以及插件的使用Demo,具体请参看百度移动统计的开发文档。 官方提供的插件功能齐全,但是封装得还不够傻瓜化。插件安装之后还需要修改原生的一些文件才能使用,这对不懂原生的cordova和ionic developer来说是很不友好的。 该插件是基于官方提供的插件修改而来,开发者只需通过命令行安装即可使用。

ps: 该插件只支持基础分析

支持平台

iOS

iOS SDK v4.9.5 xcode版本最低要求为xcode 10

Android

Android SDK使用的是gradle上的最新版本,目前为v3.9.0.1。 因为使用了gradle上最新版本的原因,所以每次同步的时间会相对长一点,使用android studio打包apk的时候就会有最直观的感受。

安装

在线安装
cordova plugin add cordova-plugin-baidumobilestatics --variable IOSAPPID=[your iOS AppKey] --variable ANDROIDAPPID=[your Android AppKey]

cordova plugin add https://github.com/cicoco/cordova-plugin-baidumobilestatics.git --variable IOSAPPID=[your iOS AppKey] --variable ANDROIDAPPID=[your Android AppKey]
本地安装

下载插件到本地

cordova plugin add /your/local/path --variable IOSAPPID=[your iOS AppKey] --variable ANDROIDAPPID=[your Android AppKey]

API

cordova.plugins.BaiduMobStatistics.onPageStart(pageName, successFn, errorFn)

cordova.plugins.BaiduMobStatistics.onPageEnd(pageName, successFn, errorFn)

cordova.plugins.BaiduMobStatistics.onEvent(eventId, eventLabel, successFn, errorFn)

cordova.plugins.BaiduMobStatistics.onEventWithAttributes(eventId, eventLabel, attributes, successFn, errorFn)

cordova.plugins.BaiduMobStatistics.onEventDuration(eventId, eventLabel, duration, successFn, errorFn)

cordova.plugins.BaiduMobStatistics.onEventDurationWithAttributes(eventId, eventLabel, duration, attributes, successFn, errorFn)

cordova.plugins.BaiduMobStatistics.onEventStart(eventId, eventLabel, successFn, errorFn)

cordova.plugins.BaiduMobStatistics.onEventEnd(eventId, eventLabel, successFn, errorFn)

cordova.plugins.BaiduMobStatistics.onEventEndWithAttributes(eventId, eventLabel, attributes, successFn, errorFn)

使用示范

最简单的页面路径分析,在app.js里面添加$stateChangeStart监听即可实现

$rootScope.$on('$stateChangeStart',  function (event, toState, toParams, fromState, fromParams) {
      cordova.plugins.BaiduMobStatistics.onPageStart(toState.name);
      cordova.plugins.BaiduMobStatistics.onPageEnd(fromState.name);
});