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 🙏

© 2026 – Pkg Stats / Ryan Hefner

umeng-analytics-expo

v0.5.0

Published

react native umeng analytics

Downloads

4

Readme

本库是基于 @react-native-hero/umeng-analytics fork 来,主要针对 expo 框架进行了适配,并提供了响应的 mod 配置原生代码。非 expo 开发模式请使用原库

Getting started

Install the library using either Yarn:

yarn add umeng-analytics-expo

or npm:

npm install --save umeng-analytics-expo

Setup

先获取友盟平台的 appKey

Usage

import {
  // 初始化友盟时传入的 channel 参数
  CHANNEL,

  init,
  getDeviceInfo,
  getPhoneNumber,
  signIn,
  signOut,
  exitApp,
  enterPage,
  leavePage,
  sendEvent,
  sendEventLabel,
  sendEventData,
  sendEventCounter,
} from '@react-native-hero/umeng-analytics'

// 对于安卓来说,需要等用户同意隐私政策后,再调用 init,js 的 init 才是真正的初始化
// https://developer.umeng.com/docs/119267/detail/182050
init().then(() => {
  // 初始化完成
})

// 提供一个退出 app 的方法
// 好像 RN 官方也没提供此方法,单个方法不好写一个库,就放在这个库了
exitApp()

// 以下方法必须等 init() 调用结束后才能调用,否则会抛出错误

getDeviceInfo().then(data => {
  data.deviceId
  data.deviceType
  data.brand
  data.bundleId
})

getUserAgent().then(data => {
  data.userAgent
})

getPhoneNumber().then(data => {
  // 只有安卓有希望读取出本机的手机号码,前提是已获得 READ_PHONE_STATE 权限
  data.phoneNumber
})

// 帐号统计
signIn('userId')
// provider 不能以下划线开头,使用大写字母和数字标识
// 如果是上市公司,建议使用股票代码,比如 WB
signIn('userId', 'provider')
signOut()

// 页面统计,注意要配对调用
// 不能连续调用 enterPage,也不能连续调用 leavePage
enterPage('pageName')
leavePage('pageName')

// 自定义事件,eventId 需先在友盟后台注册之后才可以统计
sendEvent('eventId')
sendEventLabel('eventId', 'label')
sendEventData('eventId', { key1: 'value1', key2: 'value2' })
sendEventCounter('eventId', { key1: 'value1', key2: 'value2' }, 1)