hypertrack-sdk-expo
v4.4.0
Published
Config plugin to auto configure hypertrack-sdk-react-native on prebuild
Downloads
314
Maintainers
Readme
Expo config plugin for React Native HyperTrack SDK
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
Install HyperTrack SDK React Native
npx expo install 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
Check the detailed installation guide for React Native here.
Install Expo plugin
npx expo install hypertrack-sdk-expo
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.",
"motionPermission": "We need your motion to improve in-app experience."
}
]
]
}
}
You can check more plugin configuration options here.
Set up push notifications
- 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.
Sample code
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
|
| -------- | --------------------- | ----------------------------- |
| ^51.0.32 | ^4.3.0 | ^13.5.1 |
| ^50.0.4 | 4.2.0 | ^13.1.0 |
| ^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 |
FAQ
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): SetsNSLocationAlwaysAndWhenInUseUsageDescription
,NSLocationAlwaysUsageDescription
,NSLocationWhenInUseUsageDescription
motionPermission
(string): SetsNSMotionUsageDescription
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"
}
]
]
}
}