# rn-talkingdata

> TalkingData React Native 插件

Latest version **0.0.4** (published 2018-12-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install rn-talkingdata
pnpm add rn-talkingdata
yarn add rn-talkingdata
bun add rn-talkingdata
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2018-12-05 |
| First published | 2018-12-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | pantao |
| Maintainers | pantao |
| Keywords | react-native, ios, android, talkingdata |

## Links

- npm: https://www.npmjs.com/package/rn-talkingdata
- Repository: https://github.com/pantao/react-native-talkingdata
- Homepage: https://github.com/pantao/react-native-talkingdata#readme
- Issues: https://github.com/pantao/react-native-talkingdata/issues
- npm.io page: https://npm.io/package/rn-talkingdata

## Recent versions

- 0.0.4 (latest) — 2018-12-05
- 0.0.3 — 2018-12-03
- 0.0.1 — 2018-12-03
- 0.0.0 — 2018-12-03

## README

# rn-talkingdata

TalkingData React Native 插件

## 安装

```bash
yarn add rn-talkingdata
```

## 链接

```bash
react-native link
```

### iOS工程配置

在工程 `target`的 `Build Phases->Link Binary with Libraries` 中加入 `CoreTelephony.framework、AdSupport.framework、SystemConfiguration.framework、Security.framework、CoreMotion.framework、liz.tbd`

在你工程的`AppDelegate.m`文件中添加如下代码：

```
#import "RCTTalkingData.h"


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
	// 添加在第一行
  [RCTTalkingData registerApp:@"APPID" channelID:@"渠道号" crashReport:YES];
  ...
  ...

}

```

### 安装Android工程

在`android/app/build.gradle`里，defaultConfig栏目下添加如下代码：

```
	manifestPlaceholders = [
           TD_APPID: "talkingdata的APPID",//在此修改微信APPID
           APP_CHANNEL: "渠道号",
   	]
```

在你自定义的MainActivity的onCreate()中第一行加入

```
	TalkingDataModule.register(getApplicationContext(), null, null, true);
```


## 如何使用

### 引入包

```
import * as TD from 'react-native-talkingdata';
```

### API

#### TD.trackPageBegin(page_name)
#### TD.trackPageEnd(page_name)
#### TD.trackEvent(event_name, event_label, parameters)
#### TD.setLocation(latitude, longitude)
#### TD.getDeviceID()

---
_Source: https://npm.io/package/rn-talkingdata · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
