hypertrack-sdk-expo
TypeScript icon, indicating that this package has built-in type declarations

4.1.0 • Public • Published

Expo config plugin for React Native HyperTrack SDK

GitHub npm hypertrack-sdk-react-native

HyperTrack lets you add live location tracking to your mobile app. Live location is made available along with ongoing activity, tracking controls and tracking outage with reasons.

React Native HyperTrack SDK is a wrapper around native iOS and Android SDKs that allows to integrate HyperTrack into React Native apps.

Expo config plugin enables usage of React Native HyperTrack SDK with Expo managed workflow.

For information about how to get started with Expo and React Native HyperTrack SDK, please check this Guide.

Installation

  • npx expo install hypertrack-sdk-expo
  • npx expo install hypertrack-sdk-react-native

Add HyperTrack Expo plugin to the app

Add hypertrack-sdk-expo to plugins array of your app.json or app.config.js:

{
  "expo": {
    "plugins": [
      [
        "hypertrack-sdk-expo",
        {
          "publishableKey": "YourPublishableKey", // find this in the HyperTrack dashboard
          "locationPermission": "We need your location to track delivered orders."
        }
      ]
    ]
  }
}

Set required build properties

Use expo-build-properties to set build properties.

Run npx expo install expo-build-properties and add this to plugins in app.json or app.config.js:

[
  "expo-build-properties",
  {
    "android": {
      "minSdkVersion": 21
    }
  }
]

Set up push notifications

Manual Setup

For `Bare workflow projects, you can follow the manual setup guide for React Native.

Sample code

Quickstart Expo app

Wrapper API Documentation

Wrapper API Documentation

Versioning

Ensure you use versions that work together! These are the ones that have been tested by us at the time of release:

expo hypertrack-sdk-expo hypertrack-sdk-react-native
^50.0.4 4.1.0 ^13.1.0
^49.0.13 4.0.1 ^11.0.9
^49.0.0 4.0.0 ^11.0.2
^48.0.0 3.0.0 ^9.0.0
^47.0.0 2.0.0 ^9.0.0
^46.0.14 1.2.0 ^8.2.1
^46.0.14 1.1.0 ^8.2.1
^45.0.0 1.0.0 ^7.19.1

Working around missing device push token on iOS

If your devices are missing the push token, as a workaround you can set proxyDevicePushTokenCall plugin property to true. This will ensure you are calling HyperTrack SDK as soon as the device token is received in the AppDelegate.

Configuring permission purpose strings

iOS requires specifying permission purpose strings in Info.plist for app to build.

You can use plugin parameters described below to set the strings.

Every time you change the props or plugins, you'll need to rebuild (and prebuild) the native app.

  • locationPermission (string): Sets NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription

  • motionPermission (optional string): Sets NSMotionUsageDescription

Edit hypertrack-sdk-expo item in your app.json or app.config.js:

{
  "expo": {
    "plugins": [
      [
        "hypertrack-sdk-expo",
        {
          "locationPermission": "PUT_YOUR_PERMISSION_HINT_MESSAGE_HERE",
          "motionPermission": "PUT_YOUR_PERMISSION_HINT_MESSAGE_HERE"
        }
      ]
    ]
  }
}

Package Sidebar

Install

npm i hypertrack-sdk-expo

Weekly Downloads

86

Version

4.1.0

License

MIT

Unpacked Size

18.3 kB

Total Files

11

Last publish

Collaborators

  • hypertrack