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
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-firebaseAdd 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): SetsNSLocationAlwaysAndWhenInUseUsageDescription,NSLocationWhenInUseUsageDescriptionmotionPermission(string): SetsNSMotionUsageDescription
Set up silent push 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.
Set the publishableKey parameter of the hypertrack-sdk-expo config plugin.
Set Worker Handle
To link a Worker with the device you should set the worker handle:
HyperTrack.setWorkerHandle("user_id") // unique user identifierSee Worker Setup guide for more information.
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.
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
SDK integration examples
To learn more about SDK integration examples, you may visit these resources:
Support
Join our Slack community for instant responses.
Updated 25 days ago