# drivekitcorebridge

> You can use this to access DriveKitCore functions in your React Native app.

Latest version **1.2.4** (published 2020-07-31) · 0 weekly downloads

## Install

```sh
npm install drivekitcorebridge
pnpm add drivekitcorebridge
yarn add drivekitcorebridge
bun add drivekitcorebridge
```

## 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.2.4 |
| Published | 2020-07-31 |
| First published | 2020-07-08 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 157.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | fannyt |

## Links

- npm: https://www.npmjs.com/package/drivekitcorebridge
- npm.io page: https://npm.io/package/drivekitcorebridge

## Dependencies (2)

- [react](https://npm.io/package/react.md) 16.11.0
- [react-native](https://npm.io/package/react-native.md) 0.62.2

## Recent versions

- 1.2.4 (latest) — 2020-07-31
- 1.2.3 — 2020-07-30
- 1.2.2 — 2020-07-30
- 1.2.1 — 2020-07-30
- 1.2.0 — 2020-07-30
- 1.1.2 — 2020-07-28
- 1.1.1 — 2020-07-27
- 1.1.0 — 2020-07-27
- 1.0.5 — 2020-07-27
- 1.0.4 — 2020-07-27
- 1.0.3 — 2020-07-27
- 1.0.2 — 2020-07-27
- 1.0.1 — 2020-07-27
- 1.0.0 — 2020-07-10
- 0.0.1 — 2020-07-08

## README

# DriveKitCoreBridge

You can use this to access DriveKitCore functions in your React Native app.

## Installation

```bash
npm install drivekitcorebridge
```

### iOS

Add the following line to your podfile:
```pod
target 'my-target' do
  pod 'DriveKitCore'
end
```
Then, run `pod install`.

## Set up

Before being able to use the component, you need to add the native files to your app so they can be compiled with it.

### iOS

- Open your **projectname.xcworkspace/** by using the following command from the root of your React Native app:
```bash
open ios/projectname.xcworkspace
```
- Then, go to **Build Phases** and click on the **+**  sign in **Compile Sources**.
- In the popup window, click on **Add Other...**
- Select for the **DriveKitCoreBridge.m** and **DriveKitCoreBridge.swift** files of the package in **projectname** > **node_nodules** > **drivekitcorebridge** > **ios** and click **Open**. 
- Make sure **Create folder references** is checked and click on **Finish**.

The added files should now be on the list in **Compile Sources**.

To initialize DriveKit in your app, you must call the initialization method in the `didFinishLaunchingWithOptions` method of your application class in the **AppDelegate.swift** file if the **ios/** folder.

```swift
import DriveKitCore

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  DriveKit.shared.initialize()
...
}
```

## Usage

Import the class using the following line:

```jsx
import DriveKitCore from 'drivekitcorebridge'
```

### Add API Key

To use DriveKit framework, you have to obtain an API Key from DriveQuant. If you don't have an API key, please contact DriveQuant.

Once your API key is securely stored in your application, you can configure DriveKit by calling the following method:
```jsx
DriveKitCore.setApiKey("someApiKey")
```

### Identify user

Each driver must be identified with a unique identifier. Once you have this identifier, configure DriveKit by calling the following method:
```jsx
DriveKitCore.registerUser("someUserId")
```

### Check your configuration

You can check if DriveKit SDK is well configured with the following method:
```jsx
isDriveKitCoreConfigured = await DriveKitCore.isConfigured()
```

### Reset

If you need to reset DriveKit configuration (user logout for example), you can call the following method:
```jsx
DriveKitCore.reset()
```

### Logging

To facilitate integration, DriveKit provides a logging feature. To activate logging, call the following method:
```jsx
DriveKitCore.enableLogging()
```

Disable logging by calling:
```jsx
DriveKitCore.disableLogging()
```

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