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

@abcfe/react-native-growingio

v0.0.1

Published

GrowingIO SDK for ReactNative

Downloads

4

Readme

GrowingIO React Native SDK Reference

npm version MIT licensed


一、说明

react-native-growingio 用于RN开发者手动发送数据。

二、引入

  • npm install --save https://github.com/growingio/react-native-growingio.git#develop
  • npm install
  • react-native link react-native-growingio

iOS

  • 使用CocoaPods安装GrowingCoreKit ( pod 'GrowingCoreKit' in your Podfile and run pod update)
  • (optional) GrowingIO推荐您添加AdSupport.framework依赖库,用于来源管理激活匹配,有利于您更好的分析的数据,
    添加项目依赖库的位置在项目设置target -> 选项卡General -> Linked Frameworks and Libraries

三、配置

iOS

  • 如果react-native link react-native-growingio失败(成功则忽略此步骤),即发现Libraries中没有GrowingIORNPlugin.xcodeproj,则可手动配置; a.打开XCode's工程中, 右键点击Libraries文件夹 ➜ Add Files to <...> b.去node_modules ➜ react-native-growingio ➜ ios ➜ 选择 GrowingIORNPlugin.xcodeproj c.在工程Build Phases ➜ Link Binary With Libraries中添加libGrowingIORNPlugin.a

  • 添加初始化函数: 在 AppDelegate 中引入#import "Growing.h"并添加启动方法

      - (BOOL)application:(UIApplication *)application
      didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
          ...
          // 启动GrowingIO
          [Growing startWithAccountId:@"项目ID"];
    
          // 其他配置
          // 开启Growing调试日志 可以开启日志
          // [Growing setEnableLog:YES];
      }
  • 添加官网配置, 需要重构后的文档

四、方法说明

| 方法名 | 参数 | 说明| |:-----:|-----|:-------:| | track|(String eventId, Object eventLevelVariable(optional))| 自定义事件(计数器类型)| | trackWithNumber|(String eventId, Number number, Object eventLevelVariable(optional))| 自定义事件(数值类型)| | setUserId | (String userId)| 设置登录用户ID | | clearUserId | | 清除登录用户ID | | setEvar | (Object conversionVariables) | 设置转化变量 | | setPeopleVariable | (Object peopleVariables)| 设置用户变量 | | setVisitor | (Object visitor)| 设置访问用户变量 |

五、JS中调用方式:

  • 在定义Component之前引入

      import {
        NativeModules
      } from 'react-native';
  • 之后就可以使用GrowingIO的方法,例如在js中调用自定义事件方法:

      NativeModules.GrowingIO.track("registerSuccess", {"gender":"male"});

Tips

  1. demo 可见 examples/App.js