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

react-native-umeng-analytics

v0.2.5

Published

``` npm install react-native-umeng-analytics react-native link react-native-umeng-analytics ```

Downloads

61

Readme

react-native-umeng-analytics

##安装

npm install react-native-umeng-analytics
react-native link react-native-umeng-analytics

##集成到iOS 1.请在你的工程目录结构中,添加友盟统计框架,在选项TARGETS--> Build Phases-->Link Binary With Libraries-->Add Other, 选择文件node_modules/react-native-umeng-analytics/ios/analytics_ios_5.4.1/UMAnalytics.framework 选择文件node_modules/react-native-umeng-analytics/ios/common_ios_1.4.2/normal/UMCommon.framework

2.在工程目录结构中,添加友盟框架引用,在TARGETS-->Build Settings-->Framework Search Paths, 添加: $(SRCROOT)/../node_modules/react-native-umeng-analytics/ios/analytics_ios_5.4.1 $(SRCROOT)/../node_modules/react-native-umeng-analytics/ios/common_ios_1.4.2/normal

3.添加依赖库:CoreTelephony.framework,libz.tbd,libsqlite.tbd,SystemConfiguration.framework

AppDelegate.m中添加

#import "RNUMConfigure.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [RNUMConfigure initWithAppkey:key channel:channelId];
  return YES;
}

详情参考:友盟IOSSDK集成指南

##集成到android

####添加配置 在AndroidManifest.xml中添加权限

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>

MainApplication中添加

    @Override
    public void onCreate() {
        super.onCreate();
        UMConfigure.init(this, key, channelId, UMConfigure.DEVICE_TYPE_PHONE, null);
        MobclickAgent.openActivityDurationTrack(false);
    }

MainActivity.java中添加

    @Override
    public void onResume() {
        super.onResume();
        MobclickAgent.onResume(this);

    }

    @Override
    public void onPause() {
        super.onPause();
        MobclickAgent.onPause(this);
    }

代码混淆

-keep class com.umeng.** {*;}
-keepclassmembers class * {
   public <init> (org.json.JSONObject);
}
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

详情参考:友盟AndroidSDK集成指南

##API

| API | Note |
|---|---| | beginLogPageView | 进入页面的时候调用的方法 | | event | 事件采集 | | eventWithAttributes | 带属性的事件采集 | | setDebugMode | 设置调试模式 | | onProfileSignIn | 用户登录 | | onProfileSignInWithProvider | 第三方用户登录 | | onProfileSignOff | 用户注销 |

##Usage

import UmengAnalytics from 'react-native-umeng-analytics'

//页面采集
UmengAnalytics.beginLogPageView(currentPage);

//事件采集
UmengAnalytics.event(event)
UmengAnalytics.eventWithAttributes(event,attributes)

//调试模式
UmengAnalytics.setDebugMode(true)

//用户登录采集
UmengAnalytics.onProfileSignIn(userId)

//第三方用户登录采集
UmengAnalytics.onProfileSignInWithProvider("WB",userId)

//用户注销
UmengAnalytics.onProfileSignOff()