Skip to content

Commit

Permalink
Use HyperTrack SDK with static API (#23)
Browse files Browse the repository at this point in the history
Update HyperTrack SDK Android to 7.0.9 and iOS to 5.0.7.
Remove Ionic Cordova quickstart link for README.
  • Loading branch information
pavel-kuznetsov-hypertrack authored Nov 29, 2023
1 parent 808122f commit 29a763d
Show file tree
Hide file tree
Showing 26 changed files with 1,710 additions and 1,645 deletions.
413 changes: 195 additions & 218 deletions API-DOCUMENTATION.md

Large diffs are not rendered by default.

162 changes: 137 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,65 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2023-11-29

We are excited to announce the release of HyperTrack Cordova SDK 2.0.0, a major update to our location tracking SDK. This release ensures highest tracking performance, reduces deployed app sizes and comes with an improved API to simplify the integrations. We highly recommend upgrading, but please note that there are a few breaking changes. Check the [Migration Guide](https://hypertrack.com/docs/migration-guide).

### Added

- `locate()` to ask for one-time user location
- `subscribeToLocation()` to subscribe to user location updates
- `getErrors()`
- `getName()`
- `getMetadata()`
- HyperTrackError types:
- `noExemptionFromBackgroundStartRestrictions`
- `permissionsNotificationsDenied`

### Changed

- Updated HyperTrack SDK Android to [7.0.9](https://github.com/hypertrack/sdk-android/releases/tag/7.0.9)
- Added Android SDK plugins (`location-services-google` and `push-service-firebase`)
- Updated HyperTrack SDK iOS to 5.0.7
- The whole HyperTrack API is now static
- Changed the way to provide publishableKey (you need to add `HyperTrackPublishableKey` `meta-data` item to your `AndroidManifest.xml` and `Info.plist`)
- Renamed HyperTrackError types:
- `gpsSignalLost` to `locationSignalLost`
- `locationPermissionsDenied` to `permissionsLocationDenied`
- `locationPermissionsInsufficientForBackground` to `permissionsLocationInsufficientForBackground`
- `locationPermissionsNotDetermined` to `permissionsLocationNotDetermined`
- `locationPermissionsProvisional` to `locationPermissionsProvisional`
- `locationPermissionsReducedAccuracy` to `permissionsLocationReducedAccuracy`
- `locationPermissionsRestricted` to `permissionsLocationRestricted`
- Renamed `isAvailable()` to `getIsAvailable()`
- Renamed `isTracking()` to `getIsTracking()`
- Renamed `setAvailability()` to `setIsAvailable(boolean)`
- Changed `startTracking()` and `stopTracking()` to `setIsTracking(boolean)`
- Renamed `subscribeToTracking()` to `subscribeToIsTracking()`
- Renamed `subscribeToAvailability()` to `subscribeToIsAvailable()`
- Renamed `unsubscribeFromTracking()` to `unsubscribeFromIsTracking()`
- Renamed `unsubscribeToAvailability()` to `unsubscribeFromIsAvailable()`

### Removed

- `initialize()` method (the API is now static)
- `SdkInitParams` (the config now should be done with the `AndroidManifest` metadata and `Info.plist`)
- Motion Activity permissions are not required for tracking anymore
- HyperTrackError types:
- `motionActivityPermissionsDenied`
- `motionActivityServicesDisabled`
- `motionActivityServicesUnavailable`
- `motionActivityPermissionsRestricted`
- `networkConnectionUnavailable`
- `sync()` method

## [1.1.0] - 2023-07-09

### Added

- `addGeotageWithExpectedLocation()` method
- `addGeotagWithExpectedLocation()` method
- API Documentation


## [1.0.3] - 2023-06-16

### Changed
Expand All @@ -20,23 +71,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.2] - 2023-06-15

### Changed

- Updated HyperTrack Android SDK to 6.4.2

## [1.0.1] - 2023-06-01

### Changed

- Updated HyperTrack iOS SDK to 4.16.0

## [1.0.0] - 2023-02-10

### Changed

- Updated HyperTrack Android SDK to 6.4.0
- Updated HyperTrack iOS SDK to 4.14.0
- Plugin exported object renamed from `hypertrack` to `HyperTrack`
- `setDeviceName()` renamed to `setName()`
- `setDeviceMetadata()` renamed to `setMetadata()`
- `addGeoTag()` renamed to `addGeotag()`
- `syncDeviceSettings()` renamed to `sync()`

### Added

- `subscribeToTracking()`
- `subscribeToAvailability()`
- `subscribeToErrors()`
Expand All @@ -47,129 +104,184 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `setAvailability()`
- Location result for `addGeotag`
- `getLocation()`

### Removed

- `getBlockers()`
- `requestPermissionsIfNecessary()`
- `allowMockLocations()` (use `allowMockLocations` param in `initialize()` istead)
- `setTrackingNotificationProperties()`
- `isRunning`

## [0.6.4] - 2022-07-08

### Changed

- Updated Hypertrack Android SDK to [6.2.2](https://github.com/hypertrack/sdk-android/blob/master/CHANGELOG.md#622---2022-08-30)

## [0.6.3] - 2022-07-29

### Changed

- Fix issue with missing com.google.gson dependency

## [0.6.2] - 2022-07-08

### Changed

- Updated Hypertrack iOS SDK to [4.12.3](https://github.com/hypertrack/sdk-ios/blob/master/CHANGELOG.md#4123---2022-06-13)

## [0.6.1] - 2022-07-08

### Changed

- Updated Hypertrack Android SDK to [6.1.4](https://github.com/hypertrack/sdk-android/blob/master/CHANGELOG.md#614---2022-06-17)

## [0.6.0] - 2022-05-04

### Changed

- Updated Hypertrack Android SDK to [6.0.4](https://github.com/hypertrack/sdk-android/blob/master/CHANGELOG.md#604---2022-04-29)

## [0.5.0] - 2022-04-05

### Added
- getLatestLocation and getCurrentLocation methods

- getLatestLocation and getCurrentLocation methods

## [0.4.2] - 2021-11-11

### Changed

- Updated Hypertrack Android SDK to [5.4.5](https://github.com/hypertrack/sdk-android/releases/tag/v5.4.5)

## [0.4.1] - 2021-08-25

### Changed

- Updated to ue Android SDK v5.4.0

## [0.4.0] - 2021-07-02

### Changed

- Updated to ue Android SDK v5.2.5

## [0.3.0] - 2021-06-09

### Changed

- Updated to ue Android SDK v5.2.0

### Added

- `getBlockers` method that returns a list of issues, that must be resolved for the reliable tracking. E.g. you can block user access to the screen, that enables tracking feature, utill all the blockers are resolved using the following approach:
```js
hypertrack.getBlockers(
function(blockers) {
let dialogConfig = [];
blockers.forEach(blocker =>
let menuItem = {
title: blocker.userActionTitle,
buttonName: blocker.userActionCTA,
onClick: function() {blocker.resolve(success, error);},
actionExplanation: blocker.userActionExplanation
};
dialogConfig.push(menuItem);
);
if (dialogConfig.length) showErrorDialog(dialogConfig);
},
function(error) {
console.log("Can't get blockers due to the error: " + error);
}
);
```
```js
hypertrack.getBlockers(
function(blockers) {
let dialogConfig = [];
blockers.forEach(blocker =>
let menuItem = {
title: blocker.userActionTitle,
buttonName: blocker.userActionCTA,
onClick: function() {blocker.resolve(success, error);},
actionExplanation: blocker.userActionExplanation
};
dialogConfig.push(menuItem);
);
if (dialogConfig.length) showErrorDialog(dialogConfig);
},
function(error) {
console.log("Can't get blockers due to the error: " + error);
}
);
```

## [0.2.1] - 2021-05-25

### Fixed

- plugin import error fixed

## [0.2.0] - 2021-05-23

### Changed

- Updated to use Android SDK v5.0.0
### Added

### Added

- Geotag method returns geotag location or the reason, why it can't be determined

### Removed

- Possibility to restrict the geotag.

## [0.1.1] - 2021-05-07

### Changed

- Updated to use Android SDK v4.12.0

## [0.1.0] - 2021-04-05

### Added

- Possibility to restrict a geotag to a certain location.

### Changed

- Updated to use Android SDK v4.11.0

### Fixed

- Start tracking from SDK on Android 11 won't ask for background location access.

## [0.0.6] - 2020-12-24

### Changed

- Updated to use Android SDK v4.9.0
- Firebase messaging service conflict was fixed.

## [0.0.5] - 2020-11-02

### Changed

- Updated to use Android SDK v4.8.0

## [0.0.4] - 2020-10-22

### Fixed

- Android push token updates and messages are forwarded to [FCM Plugin](https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated) if it's present in project.

## [0.0.3]

### Fixed

- Expected location in geotags not been passed from JS to Java bug.
- Android SDK was updated to v4.5.4

### Added

- Start/Stop tracking from the SDK methods
- iOS platform support

## [0.0.2] - 2020-08-06

### Fixed

- Missing notification properties setter implementation was added at Java layer.
- Device metadata setter bug was fixed.

## [0.0.1] - 2020-07-29
## [0.0.1] - 2020-07-29

### Added

- Cordova support for HyperTrack Android SDK v4.5.3

[2.0.0]: https://github.com/hypertrack/cordova-plugin-hypertrack/releases/2.0.0
[1.1.0]: https://github.com/hypertrack/cordova-plugin-hypertrack/releases/1.1.0
[1.0.3]: https://github.com/hypertrack/cordova-plugin-hypertrack/releases/1.0.3
[1.0.2]: https://github.com/hypertrack/cordova-plugin-hypertrack/releases/1.0.2
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

[![GitHub](https://img.shields.io/github/license/hypertrack/cordova-plugin-hypertrack?color=orange)](./LICENSE)
[![npm](https://img.shields.io/npm/v/cordova-plugin-hypertrack-v3.svg)](https://www.npmjs.com/package/cordova-plugin-hypertrack-v3)
[![iOS SDK](https://img.shields.io/badge/iOS%20SDK-4.16.1-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
[![Android SDK](https://img.shields.io/badge/Android%20SDK-6.4.2-brightgreen.svg)](https://github.com/hypertrack/sdk-android)
[![iOS SDK](https://img.shields.io/badge/iOS%20SDK-5.0.7-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
[![Android SDK](https://img.shields.io/badge/Android%20SDK-7.0.9-brightgreen.svg)](https://github.com/hypertrack/sdk-android)

[HyperTrack](https://www.hypertrack.com/) 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.
[HyperTrack](https://www.hypertrack.com/) 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.

Cordova HyperTrack Plugin is a wrapper around native iOS and Android SDKs that allows to integrate HyperTrack into Cordova apps.

Expand All @@ -14,14 +14,14 @@ For information about how to get started with Cordova HyperTrack SDK, please che
## Installation

Run:

```Bash
cordova plugin add cordova-plugin-hypertrack-v3
```

## Sample code

[Quickstart Cordova app](https://github.com/hypertrack/quickstart-cordova/)
[Quickstart Ionic (Cordova) app](https://github.com/hypertrack/quickstart-ionic)

## Wrapper API Documentation

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "2.0.0",
"name": "cordova-plugin-hypertrack-v3",
"cordova_name": "Cordova HyperTrack Plugin",
"description": "Cordova Plugin for native HyperTrack SDKs",
Expand Down
15 changes: 5 additions & 10 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-hypertrack-v3"
version="1.1.0">
version="2.0.0">
<name>HyperTrackPlugin</name>
<description>Cordova HyperTrack Plugin is a wrapper around native iOS and Android SDKs that allows to integrate HyperTrack into Cordova apps.</description>
<license>MIT</license>
Expand Down Expand Up @@ -34,11 +34,8 @@
<source-file src="src/android/NoCallback.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin" />
<source-file src="src/android/SubscriptionCall.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin" />
<source-file src="src/android/common/GeotagData.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin/common" />
<source-file src="src/android/common/HyperTrackError.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin/common" />
<source-file src="src/android/common/HyperTrackSdkWrapper.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin/common" />
<source-file src="src/android/common/LocationError.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin/common" />
<source-file src="src/android/common/Result.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin/common" />
<source-file src="src/android/common/SdkInitParams.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin/common" />
<source-file src="src/android/common/WrapperResult.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin/common" />
<source-file src="src/android/common/SdkMethod.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin/common" />
<source-file src="src/android/common/Serialization.kt" target-dir="java/com/hypertrack/sdk/cordova/plugin/common" />

Expand All @@ -59,13 +56,11 @@
</feature>
</config-file>

<source-file src="src/ios/common/HyperTrackError.swift" target-dir="common"/>
<source-file src="src/ios/common/DictionaryDecoder.swift" target-dir="common"/>
<source-file src="src/ios/common/GeotagData.swift" target-dir="common"/>
<source-file src="src/ios/common/HyperTrackSDKWrapper.swift" target-dir="common"/>
<source-file src="src/ios/common/SDKInitParams.swift" target-dir="common"/>
<source-file src="src/ios/common/SDKMethod.swift" target-dir="common"/>
<source-file src="src/ios/common/Serialization.swift" target-dir="common"/>
<source-file src="src/ios/common/GeotagData.swift" target-dir="common"/>
<source-file src="src/ios/common/DictionaryDecoder.swift" target-dir="common"/>
<source-file src="src/ios/HyperTrackCordovaPlugin.swift" target-dir="common"/>
<source-file src="src/ios/MethodWrapper.swift" target-dir="common"/>

Expand All @@ -81,7 +76,7 @@
<source url="https://cdn.cocoapods.org/" />
</config>
<pods use-frameworks="true">
<pod name="HyperTrack" spec="4.16.1"/>
<pod name="HyperTrack" spec="5.0.7"/>
</pods>
</podspec>

Expand Down
Loading

0 comments on commit 29a763d

Please sign in to comment.