Skip to content

Commit

Permalink
Add worker handle support (#38)
Browse files Browse the repository at this point in the history
Update HyperTrack SDK React Native to 13.4.0
  • Loading branch information
pavel-kuznetsov-hypertrack authored Jun 19, 2024
1 parent e6f0be7 commit 33473c7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 36 deletions.
10 changes: 5 additions & 5 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ PODS:
- hermes-engine (0.72.4):
- hermes-engine/Pre-built (= 0.72.4)
- hermes-engine/Pre-built (0.72.4)
- HyperTrack (5.5.4)
- hypertrack-sdk-react-native (13.3.4):
- HyperTrack (= 5.5.4)
- HyperTrack (5.6.0)
- hypertrack-sdk-react-native (13.4.0):
- HyperTrack (= 5.6.0)
- React-Core
- libevent (2.1.12)
- OpenSSL-Universal (1.1.1100)
Expand Down Expand Up @@ -678,8 +678,8 @@ SPEC CHECKSUMS:
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
hermes-engine: 81191603c4eaa01f5e4ae5737a9efcf64756c7b2
HyperTrack: cb0dea255b6d8a98e0b6966027447f3f0a6a11e9
hypertrack-sdk-react-native: 0635f5d194e607ac85a27a5077a7a8a637b1374c
HyperTrack: a061c5fdc30fe463b3065a6da60a46695582ac40
hypertrack-sdk-react-native: 6d5776eb30a72d3ada23c0145bc2316494739095
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"test": "jest"
},
"dependencies": {
"hypertrack-sdk-react-native": "13.3.4",
"hypertrack-sdk-react-native-plugin-android-location-services-google": "13.3.4",
"hypertrack-sdk-react-native-plugin-android-push-service-firebase": "13.3.4",
"hypertrack-sdk-react-native": "13.4.0",
"hypertrack-sdk-react-native-plugin-android-location-services-google": "13.4.0",
"hypertrack-sdk-react-native-plugin-android-push-service-firebase": "13.4.0",
"react": "18.2.0",
"react-native": "0.72.4"
},
Expand Down
35 changes: 21 additions & 14 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,36 @@ const App = () => {
HyperTrack.setName(name);
console.log('setName', name);

let platformName = '';
if (Platform.OS === 'android') {
platformName = 'android';
} else if (Platform.OS === 'ios') {
platformName = 'ios';
}
const metadata = {
/**
* `driver_handle` is used to link the device and the driver.
* You can use any unique user identifier here.
* The recommended way is to set it on app login in set it to null on logout
* (to remove the link between the device and the driver)
**/
driver_handle: `test_driver_quickstart_react_native_${platformName}`,
/**
* You can also add any custom data to the metadata.
* Metadata is an custom data that is linked to the device.
*/
source: name,
employee_id: Math.round(Math.random() * 10000),
};
HyperTrack.setMetadata(metadata);
console.log('setMetadata', metadata);

let platformName = '';
if (Platform.OS === 'android') {
platformName = 'android';
} else if (Platform.OS === 'ios') {
platformName = 'ios';
}
/**
* Worker handle is used to link the device and the worker.
* You can use any unique user identifier here.
* The recommended way is to set it on app login in set it to null on logout
* (to remove the link between the device and the worker)
**/
HyperTrack.setWorkerHandle(
`test_driver_quickstart_react_native_${platformName}`,
);
console.log('workerHandle is set');

const workerHandle = await HyperTrack.getWorkerHandle();
console.log('getWorkerHandle', workerHandle);

errorsListener.current = HyperTrack.subscribeToErrors(
(errors: HyperTrackError[]) => {
let result = getErrorsText(errors);
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3637,20 +3637,20 @@ human-signals@^2.1.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==

hypertrack-sdk-react-native-plugin-android-location-services-google@13.3.4:
version "13.3.4"
resolved "https://registry.yarnpkg.com/hypertrack-sdk-react-native-plugin-android-location-services-google/-/hypertrack-sdk-react-native-plugin-android-location-services-google-13.3.4.tgz#5d977dda6bd752e0109ec5f69883211d9c8c6ca9"
integrity sha512-aW6XBqO+CQIlqWA0/4EChokH5j07HvCTQehP/kTWG4JkgFz85Re3nvOfAwEx05IA4/OZp8TJf5kD4xcKyswm+w==

hypertrack-sdk-react-native-plugin-android-push-service-firebase@13.3.4:
version "13.3.4"
resolved "https://registry.yarnpkg.com/hypertrack-sdk-react-native-plugin-android-push-service-firebase/-/hypertrack-sdk-react-native-plugin-android-push-service-firebase-13.3.4.tgz#c4a0860d1204204ace5b530c8d70c91394950420"
integrity sha512-sVgpLaudu5LRqtkGtksL4wq9qUyPCE4E0+6dkUL7D8U6FFLQF2HqGs2Hkh5/4FQfZOtehJSmHQWMGpfzDh63Lg==

hypertrack-sdk-react-native@13.3.4:
version "13.3.4"
resolved "https://registry.yarnpkg.com/hypertrack-sdk-react-native/-/hypertrack-sdk-react-native-13.3.4.tgz#dc16c2e134223990c06d406fcf6e3579883dc2c0"
integrity sha512-35DSqc3JjAkeE/HzZe0DumNXQSeD8KoAuGlHyHM22BTItGie1ZewxA3fZpjS6DAdAt/ew7RttMDAOcKFVBF7vw==
hypertrack-sdk-react-native-plugin-android-location-services-google@13.4.0:
version "13.4.0"
resolved "https://registry.yarnpkg.com/hypertrack-sdk-react-native-plugin-android-location-services-google/-/hypertrack-sdk-react-native-plugin-android-location-services-google-13.4.0.tgz#ed5367c9e613bb01472ec7eeb0d58b6fdc86f10c"
integrity sha512-GzX8JQtkPsmo4bq27gVv00LETCfhFADRXJE62vUptNB4URJYNhilRwAZhN3lKGP6Zo8lVHoUQzY1ra2mOpQvzQ==

hypertrack-sdk-react-native-plugin-android-push-service-firebase@13.4.0:
version "13.4.0"
resolved "https://registry.yarnpkg.com/hypertrack-sdk-react-native-plugin-android-push-service-firebase/-/hypertrack-sdk-react-native-plugin-android-push-service-firebase-13.4.0.tgz#59aa57391f035c568d248771cba814ad1108e899"
integrity sha512-7Xee7XIC1zrzqRFa69B79oK8YeItO1VwgLtmxtxly9etYgPekkLhegcxghwTKxRKPIZniY1yVWY01ee+fV8+Sw==

hypertrack-sdk-react-native@13.4.0:
version "13.4.0"
resolved "https://registry.yarnpkg.com/hypertrack-sdk-react-native/-/hypertrack-sdk-react-native-13.4.0.tgz#a2cd666ce9c27163c26b0e5dff890cff811adcf0"
integrity sha512-mzEB7Lvqudi77kdFfDcjub8vGzGN/HyRxClNqlp34k8dV230pDGKfDaKWTcrW3guuslFf0DuY7CidGcmRRppRw==

ieee754@^1.1.13:
version "1.2.1"
Expand Down

0 comments on commit 33473c7

Please sign in to comment.