# react-native-drift

> A React Native wrapper for Drift.com platform 🔗

Latest version **1.0.6** (published 2019-02-05) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2019-02-05 |
| First published | 2019-02-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | NocturneLab |
| Maintainers | c.delouvencourt |
| Keywords | react-native |

## Links

- npm: https://www.npmjs.com/package/react-native-drift
- npm.io page: https://npm.io/package/react-native-drift

## Recent versions

- 1.0.6 (latest) — 2019-02-05
- 1.0.5 — 2019-02-05
- 1.0.3 — 2019-02-05
- 1.0.2 — 2019-02-05
- 1.0.1 — 2019-02-05
- 1.0.0 — 2019-02-05

## README

<a href="https://nocturne.app"><img src="https://i.imgur.com/3b14zAm.png" align="left" height="114" width="387"/></a>      

<br>

**A simple React Native wrapper for Drift.com platform.**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


## Getting started

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

### Mostly automatic installation

`$ react-native link react-native-drift`

### Manual installation


#### iOS

1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-drift` and add `RNDrift.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNDrift.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 app.nocturne.libs.drift.RNDriftPackage;` to the imports at the top of the file
  - Add `new RNDriftPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
  	```
  	include ':react-native-drift'
  	project(':react-native-drift').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-drift/android')
  	```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
  	```
      compile project(':react-native-drift')
  	```


## Usage
```javascript
import Drift from 'react-native-drift';

// Init Drift - https://app.drift.com/settings/livechat
Drift.setup("YOUR API TOKEN");

// Create a user
Drift.registerUser("unique id of the user", "email");

// Logout user
Drift.logout();

// Display conversations view
Drift.showConversations();

// Display create conversation view
Drift.showCreateConversation();

```

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