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

@unif/react-native-umeng

v0.3.3

Published

友盟 React Native bridge: U-Share(WeChat/DingTalk) + U-App Analytics (@unif 私有)

Downloads

294

Readme

@unif/react-native-umeng

npm CI License Docs

友盟 React Native 新架构桥:U-Share(微信会话 / 钉钉分享)+ U-App 移动统计。面向 RN 0.85 新架构(TurboModule)。Unif 私有。

特性

  • U-Share — 微信会话 + 钉钉分享,支持文本 / 图片 / 链接三种内容。
  • 命令式分享面板 — 根上挂一次 <ShareSheetHost />Share.openSheet() 即可拉起,RN Modal 底部弹层 + @unif/react-native-design 组件渲染。
  • U-App 统计onEvent 自定义事件 + signIn / signOut 账号埋点。
  • PIPL 合规 — 两段式初始化(preInit 存配置不上报 → 用户同意后 init 才采集)。
  • TypeScript 优先 — 全量类型 + UmengError 错误码,随包附带官方 Jest mock。

首版只支持微信会话 + 钉钉,朋友圈 / QQ / 微博暂不支持。

安装

yarn add @unif/react-native-umeng \
  @unif/react-native-design \
  react-native-gesture-handler \
  react-native-svg

分享面板的 UI 基于 @unif/react-native-design,上述 peer 均必装;iOS 还需 pod install。微信 / 钉钉的 URL Scheme、AppDelegate、Android 回调 Activity、微信 Universal Link 等原生注册步骤较多,完整步骤见文档站 · 原生配置

快速开始

根组件包裹 <GestureHandlerRootView> + <ThemeProvider>,并挂一次 <ShareSheetHost />

import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { ThemeProvider } from '@unif/react-native-design';
import { Common, Share, ShareSheetHost, UmengError } from '@unif/react-native-umeng';

function App() {
  return (
    <GestureHandlerRootView style={{ flex: 1 }}>
      <ThemeProvider>
        <Screen />
        <ShareSheetHost />
      </ThemeProvider>
    </GestureHandlerRootView>
  );
}

// 1. App 启动预初始化(隐私协议前,不上报);所有 config 都在这里给
await Common.preInit({ appkey: 'YOUR_APPKEY', wechatAppId: 'wx…', dingtalkAppId: 'dingoa…' });
// 2. 用户同意《隐私协议》后正式启动采集;init 无参
await Common.init();

// 3. 拉起分享面板 —— 取消 / 失败都 reject,只有成功才 resolve,所以用 try/catch
try {
  const r = await Share.openSheet({ type: 'link', title: '标题', url: 'https://example.com' });
  // r.code === 'success'
} catch (e) {
  if (e instanceof UmengError && e.code === 'E_USER_CANCEL') { /* 用户取消 */ }
}

底层直拉 Share.shareLink、统计 Analytics.onEvent、错误码、PIPL 合规细节 —— 见下方文档。

文档

兼容性

仅支持 RN 0.85 新架构(New Architecture / TurboModule)、React 19。iOS + Android(不支持 Web)。

License

MIT