HyperTrack Cordova SDK Setup

To use HyperTrack SDK in your Cordova app, we first need to install the plugin. This plugin is a wrapper around the native Android and iOS SDKs.

[info] Cordova version

Verify that Cordova 6.4.0+ is installed. In case not, you can update Cordova by running the command npm install -g cordova in your terminal.

Step 1: Install the SDK

The plugin is available using the cordova cli tool.

cordova plugin add cordova-plugin-hypertrack

Step 2: Configure the SDK

In your app's config.xml set a new preference key HYPERTRACK_PK with your publishable key as the value. This key will be used by the native SDKs.

<preference name="HYPERTRACK_PK" value="YOUR_PUBLISHABLE_KEY" />

Step 3: Native capabilities

Follow these steps to setup native capabilities for iOS and Android.

Step 4: Access plugin methods

Access the plugin methods in your Cordova app.

var hypertrack = cordova.plugins.HyperTrack;

Step 5: Enable location permissions

Android

The SDK requires Location permission to be granted to the app and for Location Services to be enabled for the device.

// To request Location Permissions
var hypertrack = cordova.plugins.HyperTrack;
hypertrack.requestPermissions();

// To enable Location Services
var hypertrack = cordova.plugins.HyperTrack;
hypertrack.requestLocationServices();

Was this helpful? Yes, thanks! Not really

results matching ""

    No results matching ""