# react-native-redirapp

> React-Native wrapper for Redirapp

Latest version **1.0.2** (published 2019-03-22) · GPL-3.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-03-22 |
| First published | 2019-03-22 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 747.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ítalo Menezes at Kyte |
| Maintainers | ital0 |
| Keywords | react-native, redirapp, react-native-redirapp |

## Links

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

## Recent versions

- 1.0.2 (latest) — 2019-03-22
- 1.0.1 — 2019-03-22
- 1.0.0 — 2019-03-22

## README

# react-native-redirapp
Just an React-Native wrapper for Redirapp (if you need to use more functions than only *init*).

## Getting started

`$ npm install react-native-redirapp --save`

## Before continue (iOS only)
If you wanna use this lib with iOS, you need to change your Podfile. This is necessary because Redirapp is served via Cocoapods.
**If you know another way to link Redirapp (using Cocoapods), please open an issue or just send a PR.**

### Steps for Cocoapods
At your **YourProject/ios/Podfile** file, you need to point RNRedirapp as an additional pod (or something like this):

```ruby
platform :ios, '9.0'
use_frameworks!
workspace 'YourProject.xcworkspace'

target 'YourProject' do
    pod 'Redirapp', '0.0.6'

    target 'RNRedirapp' do
        project '../node_modules/react-native-redirapp/ios/RNRedirapp.xcodeproj'
        inherit! :search_paths
    end
end

```

Your project structure will be a little ugly. Be advised.


### Mostly automatic installation

`$ react-native link react-native-redirapp`


### Manual installation


#### iOS

1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [YourProject]`
2. Go to `node_modules` ➜ `react-native-redirapp` and add `RNRedirapp.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNRedirapp.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`).

#### Android

1. Open up `android/app/src/main/java/[...]/MainActivity.java`
  - Add `import com.kytepos.rn.redirapp.RNRedirappPackage;` to the imports at the top of the file
  - Add `new RNRedirappPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
  	```
  	include ':react-native-redirapp'
  	project(':react-native-redirapp').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-redirapp/android')
  	```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
  	```
      compile project(':react-native-redirapp')
  	```


## Usage
```javascript
import { RNRedirapp } from 'react-native-redirapp';

initRedirapp() {
	RNRedirapp.init("Your Redirapp Token");
}

logPurchase() {
	RNRedirap.logPurchase('88.77', 'com.product');
}

logPurchaseWithCurrency() {
	RNRedirap.logPurchase('BRL', '88.77', 'com.product');
}
```

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