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-janalytics-google-play

v1.0.4

Published

JAnalytics for cordova plugin with Google Play

Downloads

2

Readme

cordova-plugin-janalytics

极光的 Cordova 数据统计插件。

Waring

此插件已交由极光官方组织维护, 不再更新。

~~此插件包含jcore,当你的APP总使用了不止一个极光服务,请使用cordova-plugin-janalytics-no-jcore~~ 1.0.3版本后,jcore库已经改为弱引用(依赖于cordova-plugin-jcore),开发者不需担心多个极光插件带来的库文件冲突问题。

Install

  • 通过cordova plugin 安装,要求 Cordova CLI 5.0+:
cordova plugin add cordova-plugin-janalytics --variable API_KEY=极光KEY --variable CHANNEL=渠道名
  • 或直接通过 url 安装:
cordova plugin add https://github.com/wilhantian/cordova-plugin-janalytics --variable API_KEY=极光KEY --variable CHANNEL=渠道名
  • 或下载到本地安装:
cordova plugin add Your_Plugin_Path  --variable API_KEY=极光KEY --variable CHANNEL=渠道名

注意: CHANNEL不能为纯数字

Version Changed

  • 1.0.3 将jcore库改为弱引用,开发者不需担心多个极光插件带来的库文件冲突问题
  • 1.0.2 解决部分API不能使用的问题

API

  • 用例中的'success', 'error'参数代表成功回调函数与失败回调函数.

  • extMap为附加参数,仅能纯属一个小于10个字段的1级key-value对象 正确用例:{ a:1, b:2, c: 3} 错误用例:{a: {c: 1, b:2}}

    下面将不再提及

设置是否开启debug模式(开启后将打印更多调试信息)

Janalytics.setDebugModel(enable, success, error);

  • enable boolean 是否开启debug模式
  • success function
  • error function
Janalytics.setDebugModel(true, 
	function(){
        alert("操作成功");
	}, 
	function(err){
		alert(err);
	}
);

记录页面启动

Janalytics.onPageStart(pageName, success, error)

  • pageName string 页面名称
  • success function
  • error function

注意 此接口应当尽可能与onPageEnd对应

Janalytics.onPageStart("登陆页面", function(){}, function(err){});

记录页面结束

Janalytics.onPageEnd(pageName, success, error)

  • pageName string 页面名称
  • success function
  • error function
Janalytics.onPageEnd("登陆页面", function(){}, function(err){});

自定义计数事件

Janalytics.onCountEvent(eventId, extMap, success, error)

  • eventId string 自定义事件ID
  • extMap keyValue
  • success function
  • error function

注意 此接口属于自定义事件,需要提前到极光控制台中创建与eventId同名的事件

Janalytics.onCountEvent("计数事件测试", {a:1, b:2}, function(){}, function(err){});

自定义计算事件

Janalytics.onCalculateEvent(eventId, eventValue, extMap, success, error)

  • eventId string 自定义事件ID
  • eventValue number 计算值
  • extMap keyValue
  • success function
  • error function

注意 此接口属于自定义事件,需要提前到极光控制台中创建与eventId同名的事件

Janalytics.onCalculateEvent("计算事件测试", 1.2, {a:1, b:2}, function(){}, function(err){});

登陆事件

Janalytics.onLoginEvent(loginMethod, loginSuccess, extMap, success, error)

  • loginMethod string 登陆方式
  • loginSuccess boolean 是否成功登陆
  • extMap keyValue
  • success function
  • error function
Janalytics.onLoginEvent("QQ登陆", true, {a:1, b:2}, function(){}, function(err){});

注册事件

Janalytics.onRegisterEvent(registerMethod, registerSuccess, extMap, success, error)

  • registerMethod string 注册方式
  • registerSuccess boolean 是否成功注册
  • extMap keyValue
  • success function
  • error function
Janalytics.onRegisterEvent("手机号注册", true, {a:1, b:2}, function(){}, function(err){});

浏览事件

Janalytics.onRegisterEvent(browseId, browseName, browseType, browseDuration, extMap, success, error)

  • browseId string 浏览ID
  • browseName string 浏览名
  • browseType string 浏览类型
  • browseDuration number 浏览时长
  • extMap keyValue
  • success function
  • error function
  Janalytics.onRegisterEvent(
    browseId, //浏览ID `string`
    browseName,//浏览名 `string`
    browseType,//浏览类型 `string`
    browseDuration,//浏览时长 `long`
    extMap,
    success, error
  )

购买事件

Janalytics.onPurchaseEvent(purchaseGoodsid, purchaseGoodsName, purchasePrice, purchaseSuccess, purchaseCurrency, purchaseGoodsType, purchaseGoodsCount, purchaseGoodsCount, extMap, success, error)

  • purchaseGoodsid string 商品ID
  • purchaseGoodsName string 商品名
  • purchasePrice number 商品价格
  • purchaseSuccess boolean 是否购买成功
  • purchaseCurrency string 货币类型 ("USD":美元,"CNY":人民币)
  • purchaseGoodsType string 商品类型
  • purchaseGoodsCount number 商品数量
  • extMap keyValue
  • success function
  • error function
  Janalytics.onPurchaseEvent(
    purchaseGoodsid, //商品ID `string`
    purchaseGoodsName, //商品名 `string`
    purchasePrice, //商品价格 `float`
    purchaseSuccess, //是否购买成功  `booleabn`
    purchaseCurrency, //货币类型  `string` ("USD":美元,"CNY":人民币)
    purchaseGoodsType, //商品类型 `string`
    purchaseGoodsCount, //商品数量 `int`
    extMap,
    success, error
  )

开启崩溃收集(仅支持IOS设备, 默认是关闭的)

Janalytics.crashLogON(success, error)

  • success function
  • error function

上报地理位置(仅支持IOS设备)

Janalytics.setLocation(latitude, longitude, success, error)

  • latitude number 纬度
  • longitude number 经度
  • success function
  • error function

参考资料

极光官方janalytics开发文档

如有bug请提issues, enjoy!