Expo
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
Basic integration
Migrating from older versions? Check the Migration guide
Add HyperTrack SDK to your project
We constantly work on making our SDKs better, so make sure you have the latest version. You can get it in the changelog for our React Native library and Expo config plugin.
Install NPM dependencies
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"
]
]
}
}
Configure 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): SetsNSLocationAlwaysAndWhenInUseUsageDescription
,NSLocationAlwaysUsageDescription
,NSLocationWhenInUseUsageDescription
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",
}
]
]
}
}
Set up silent push notifications
The SDK has a bi-directional communication model with the server. This enables the SDK to run on a variable frequency model, which balances the fine trade-off between low latency tracking and battery efficiency, and improves robustness. This also enables HyperTrack Trips to start and stop tracking automatically when trip starts and ends. For this purpose, the iOS SDK uses APNs silent remote notifications and Android SDK uses FCM silent notifications.
Set up for push notifications for Expo
- For iOS, to enable push notifcations you need to add push notifications credentials
- For Android, to enable push notifcations you need to use FCM for Push Notifications
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.
Add the publishable key as to hypertrack-sdk-expo
plugin as a param:
{
"expo": {
"plugins": [
[
"hypertrack-sdk-expo",
{
"locationPermission": "PUT_YOUR_PERMISSION_HINT_MESSAGE_HERE",
"publishableKey": "YourPublishableKey",
}
]
]
}
}
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 Start Tracking 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.
Prepare for App Store and Google Play submission
Recommended additional steps
Recommended additional steps (React Native)
Migration Guide
Migration Guide (React Native)
Migration from hypertrack-sdk-expo
plugin
hypertrack-sdk-expo
pluginmotionPermission
plugin param is removed (because the SDK doesn't need the Motion activity permission anymore).
Reference
SDK integration examples
Frequently Asked Questions
Updated 8 days ago