# @pangu/react-native-umeng

> Umeng support in React Native.

Latest version **0.0.6** (published 2018-12-28) · 0 weekly downloads

## Install

```sh
npm install @pangu/react-native-umeng
pnpm add @pangu/react-native-umeng
yarn add @pangu/react-native-umeng
bun add @pangu/react-native-umeng
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2018-12-28 |
| First published | 2018-11-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | PanGu Tech |
| Maintainers | kenny_tian, pangu |
| Keywords | umeng, react-native, component, multi-language, cross-platform |

## Links

- npm: https://www.npmjs.com/package/@pangu/react-native-umeng
- Repository: https://github.com/PanGuTech/react-native-umeng
- Homepage: https://github.com/PanGuTech/react-native-umeng#readme
- Issues: https://github.com/PanGuTech/react-native-umeng/issues
- npm.io page: https://npm.io/package/@pangu/react-native-umeng

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2018-12-28
- 0.0.5 — 2018-12-28
- 0.0.4 — 2018-11-06
- 0.0.3 — 2018-11-06
- 0.0.1 — 2018-11-06

## README

# React Native Umeng

A Umeng lib for React Native

# iOS Install

```bash
$ npm install --save rn-umeng
$ rnpm link rn-umeng
```

# Android Install (Manual)

```bash
$ npm install --save rn-umeng
```

#### Add Gradle Module Manually

Module Source:

```bash
$PROJECT_DIR/node_modules/rn-umeng/android
```

![image](https://raw.githubusercontent.com/esseak/rn-umeng/master/screenshots/screenshot0.png)

![image](https://raw.githubusercontent.com/esseak/rn-umeng/master/screenshots/screenshot1.png)

#### Add UmengPackage

```java
ReactInstanceManager.builder() ...
.addPackage(new UmengPackage())
```

#### onResume and onPause
```java
@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 Side        | iOS Side           | Android Side   
--------------------------|---------------------|-----------------------
startWithAppkey(string)   | startWithAppkey(NSString)   | AnalyticsConfig.setAppkey(String appkey)
startWithAppkeyAndChannel(string,string)   | N/A   | UMAnalyticsConfig(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 *)eventId           | MobclickAgent.onEvent(Context context, String eventId)
onEvent(string,{key:"value"})      | onEvent:(NSString *)eventId attributes:(NSDictionary *)attributes           | MobclickAgent.onEvent(Context context, String eventId, HashMap map)
onEvent(string,{key:"value"},0)    | onEvent:(NSString *)eventId attributes:(NSDictionary *)attributes counter:(NSString *)counter           | MobclickAgent.onEventValue(Context context, String id, Map<String,String> m, int du)
onProfileSignIn('ID')      | profileSignInWithPUID:(NSString *)puid           | onProfileSignIn(String ID)
onProfileSignIn('ID','Provider')      | profileSignInWithPUID:(NSString *)puid provider:(NSString *)provider           | onProfileSignIn(String Provider, String ID)
onProfileSignOff()      | profileSignOff           | onProfileSignOff()
onPageStart(string)      | beginLogPageView:(NSString *)pageName           | MobclickAgent.onPageStart(String pageName)
onPageEnd(string)      | endLogPageView:(NSString *)pageName           | MobclickAgent.onPageEnd(String pageName)
onLogPageViewInseconds('pageName',10)      | logPageView:pageName seconds:seconds          | N/A
openActivityDurationTrack(boole)      |  N/A           | MobclickAgent.openActivityDurationTrack(boolean value)
onResume()      | N/A           | MobclickAgent.onResume()
onPause()      | N/A            | MobclickAgent.onPause()
getDeviceInfo((infoStr)=>{})      | getDeviceInfo           | getDeviceInfo

In your project code

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


# Changelog


### - 1.0.6
 - support RN 0.40

### - 1.0.5

 - fix error in LazyReactPackage

### - 1.0.4

 - add Android channel set

### - 1.0.3

 - add Android lib (but Manually,rnpm link not works,fix later)
 - update readme.md


### - 1.0.2
 - Project initialization

# License
MIT

---
_Source: https://npm.io/package/@pangu/react-native-umeng · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
