Expo

hypertrack-sdk-expo
hypertrack-sdk-react-native

Expo HyperTrack SDK is an Expo plugin for React Native wrapper around the native iOS and Android SDKs that allows to integrate them into Expo apps.

Requirements

Requirements for React Native

Basic integration

Updating the SDK? Check out the React Native and Expo changelogs, as well as our Migration Guide to see what's changed.

Add HyperTrack SDK to your project

Install NPM dependencies

npx expo install hypertrack-sdk-expo \
  hypertrack-sdk-react-native \
  hypertrack-sdk-react-native-plugin-android-location-services-google \
  hypertrack-sdk-react-native-plugin-android-activity-service-google \
  hypertrack-sdk-react-native-plugin-android-push-service-firebase

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 Setup page
          "locationPermission": "<APP> needs permission to use location features for <REASON>..",
          "motionPermission": "<APP> needs permission to use motion features for <REASON>.."
        }
      ]
    ]
  }
}

iOS requires specifying permission purpose strings in Info.plist for app to build. You can use plugin parameters described above 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, NSLocationWhenInUseUsageDescription
  • motionPermission (string): Sets NSMotionUsageDescription

Set up silent push notifications

Set up for push notifications for Expo

Manual Setup

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

Set the publishable key

Get your publishable key from the Setup page.

Set the publishableKey parameter of the hypertrack-sdk-expo config plugin.

Grant the permissions to the app

Grant the permissions to the app (React Native)

Start tracking

Now the app is ready to be tracked from the cloud.

You will need the device id to start tracking, check the Identify devices section for instructions on how to get it.

Follow the Track Work tutorial to learn how to control device tracking from your backend.

Dashboard

Once your app is running, go to the dashboard where you can see a list of all your devices and their live location with ongoing activity on the map.

Recommended additional steps

Recommended additional steps (React Native)

Reference

Reference (React Native)

SDK integration examples

To learn more about SDK integration examples, you may visit these resources:

Support

Join our Slack community for instant responses.