1.2.4 • Published 4 years ago

drivekitcorebridge v1.2.4

Weekly downloads
45
License
-
Repository
-
Last release
4 years ago

DriveKitCoreBridge

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

Installation

npm install drivekitcorebridge

iOS

Add the following line to your podfile:

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:
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.

import DriveKitCore

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

Usage

Import the class using the following line:

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:

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:

DriveKitCore.registerUser("someUserId")

Check your configuration

You can check if DriveKit SDK is well configured with the following method:

isDriveKitCoreConfigured = await DriveKitCore.isConfigured()

Reset

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

DriveKitCore.reset()

Logging

To facilitate integration, DriveKit provides a logging feature. To activate logging, call the following method:

DriveKitCore.enableLogging()

Disable logging by calling:

DriveKitCore.disableLogging()
1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.2

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago