New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@wumin/react-native-tracker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wumin/react-native-tracker

React Native 埋点

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

rn-tracker

React Native 埋点

已实现 - pv、uv、首屏渲染时间统计

使用API

下载安装

    yarn add @wumin/react-native-tracker

初始化

import DUTracker from '@wumin/react-native-tracker'

DUTracker.init('http://xxx.com/api/', {
    projectInfo: {
        appName: '应用名称',
        appVersion: '应用版本号',
        env: '应用环境'
    }
})

登录关联

DUTracker.login('userid12121')

把需要埋点的路由组件包装,例如:

function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator>
        <Stack.Screen name="首页" component={DUTracker.tracking(HomeScreen)} />
        <Stack.Screen name="Details" component={DUTracker.tracking(DetailsScreen)} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}

AppRegistry.registerComponent(appName, () => App);

主动上报

DUTracker.report({
    event: 'click',
    type: '1'
})

FAQs

Package last updated on 24 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts