# react-native-geetest

> Geetest binding for React Native

Latest version **0.5.1** (published 2020-03-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-geetest
pnpm add react-native-geetest
yarn add react-native-geetest
bun add react-native-geetest
```

## 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.5.1 |
| Published | 2020-03-25 |
| First published | 2016-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Messense Lv |
| Maintainers | messense |
| Keywords | react-native, geetest |

## Links

- npm: https://www.npmjs.com/package/react-native-geetest
- Repository: https://github.com/bosondata/react-native-geetest
- Issues: https://github.com/bosondata/react-native-geetest/issues
- npm.io page: https://npm.io/package/react-native-geetest

## Recent versions

- 0.5.1 (latest) — 2020-03-25
- 0.5.0 — 2020-03-24
- 0.4.2 — 2017-10-30
- 0.4.1 — 2017-08-03
- 0.4.0 — 2017-01-12
- 0.3.0 — 2016-12-25
- 0.2.1 — 2016-12-14
- 0.2.0 — 2016-12-13
- 0.1.1 — 2016-12-07
- 0.1.0 — 2016-12-07

## README

# react-native-geetest

Geetest binding for react-native

## Installation

For npm:

```bash
$ npm install --save react-native-geetest
```

For Yarn:

```bash
$ yarn add react-native-geetest
```

## Link - iOS

### Manually

* Right click on Libraries, select **Add files to "…"** and select `node_modules/react-native-geetest/RNGeetest.xcodeproj`

* Select your project and under **Build Phases -> Link Binary With Libraries**, press the + and select `libRNGeetest.a`

### With `react-native link`

```bash
$ react-native link
```


## Link - Android

Add to `android/settings.gradle`:

```
include ':geetest-sdk'
project(':geetest-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-geetest/android/gtsdk/sdk')
include ':react-native-geetest'
project(':react-native-geetest').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-geetest/android')
```

Add the compile project line to `android/app/build.gradle` (inside `dependencies`):

```
dependencies {
    // ... other content ... 
    compile project(':react-native-geetest')
}
```

Inside `MainApplication.java` (normally somewhere here android/app/src/main/java/com/<your-app-name>/MainApplication.java)
 add `import import com.riskstorm.geetest.GeetestPackage;` and `new GeetestPackage()` like in the example below

 ```
 import com.riskstorm.geetest.GeetestPackage;

 /* ... other content ... */

   @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new GeetestPackage()
      );
    }
 ```

## Usage

```javascript
import Geetest from 'react-native-geetest'

Geetest.setChallengeURL('Your challenger URL');
Geetest.setValidateURL('Your validate URL');

Geetest.request().then(() => {
  alert('success');
}).catch(() => {
  alert('failure');
});
```

Also you can listen to `GeetestValidationFinished` event using `DeviceEventEmitter`,
please view details in the Example project.

## License

MIT

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