New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-umeng-rcat

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-umeng-rcat

umeng最新的jar包

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Umeng

A Umeng lib for React Native

iOS Install

npm install react-native-umeng-rcat --save

package.json 里添加:

"rn-umeng": "git+https://github.com/RnTouna/rn-umeng.git"

然后执行命令

yarn install (或 npm install)
react-native link rn-umeng

在工程target的 Build Phases->Link Binary with Libraries 中加入 CoreTelephony.framework libz.tbd libsqlite3.tbd

Build Settings->Search Paths->Framework Search Paths 中加入路径 $(SRCROOT)/../node_modules/rn-umeng/ios/RCTUmeng/RCTUmeng/UMAnalytics_Sdk

Build Settings->Link->Other Linker Flags 中加入 -framework "UMMobClick"

Android Install (Manual)

$ npm install --save rn-umeng
Add Gradle Module Manually

Module Source:

$PROJECT_DIR/node_modules/rn-umeng/android

image

image

Add UmengPackage
ReactInstanceManager.builder() ...
.addPackage(new UmengPackage())
onResume and onPause
@Override
protected void onResume() {
	super.onResume();
	MobclickAgent.onResume(this);
}

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

Usage

The api mapping below

React Native SideiOS SideAndroid Side
startWithAppkey(string)startWithAppkey(NSString)AnalyticsConfig.setAppkey(String appkey)
startWithAppkeyAndChannel(string,string)N/AUMAnalyticsConfig(Context context, String appkey, String channelId)
setAppVersion(string)setAppVersion(string)Not need to set it
setDebugMode(bool)setLogEnabled(BOOL)MobclickAgent.setDebugMode( true )
enableEncrypt(boole)setEncryptEnabled(BOOL)AnalyticsConfig.enableEncrypt(boolean enable)
setCrashReportEnabled(boole)setCrashReportEnabled(BOOL)MobclickAgent.setCatchUncaughtExceptions(false)
onEvent(string)event:(NSString *)eventIdMobclickAgent.onEvent(Context context, String eventId)
onEvent(string,{key:"value"})onEvent:(NSString *)eventId attributes:(NSDictionary *)attributesMobclickAgent.onEvent(Context context, String eventId, HashMap map)
onEvent(string,{key:"value"},0)onEvent:(NSString *)eventId attributes:(NSDictionary *)attributes counter:(NSString *)counterMobclickAgent.onEventValue(Context context, String id, Map<String,String> m, int du)
onProfileSignIn('ID')profileSignInWithPUID:(NSString *)puidonProfileSignIn(String ID)
onProfileSignIn('ID','Provider')profileSignInWithPUID:(NSString *)puid provider:(NSString *)provideronProfileSignIn(String Provider, String ID)
onProfileSignOff()profileSignOffonProfileSignOff()
onPageStart(string)beginLogPageView:(NSString *)pageNameMobclickAgent.onPageStart(String pageName)
onPageEnd(string)endLogPageView:(NSString *)pageNameMobclickAgent.onPageEnd(String pageName)
onLogPageViewInseconds('pageName',10)logPageView:pageName seconds:secondsN/A
openActivityDurationTrack(boole)N/AMobclickAgent.openActivityDurationTrack(boolean value)
onResume()N/AMobclickAgent.onResume()
onPause()N/AMobclickAgent.onPause()
getDeviceInfo((infoStr)=>{})getDeviceInfogetDeviceInfo

In your project code

import MobclickAgent from 'rn-umeng';
MobclickAgent.startWithAppkey('your appkey');
MobclickAgent.setDebugMode(true);
MobclickAgent.onEvent("testEvent");

License

MIT

Keywords

FAQs

Package last updated on 18 Dec 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc