Skip to content

Commit

Permalink
Update HyperTrack SDK iOS to 5.8.0 and Android to 7.8.0 (#114)
Browse files Browse the repository at this point in the history
Add Activity service plugin

---------

Co-authored-by: Pavel Kuznetsov <[email protected]>
  • Loading branch information
ferologics and pavel-kuznetsov-hypertrack authored Sep 5, 2024
1 parent 2a38568 commit 2e41325
Show file tree
Hide file tree
Showing 48 changed files with 10,290 additions and 30 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [13.6.0] - 2024-09-05

### Added

- Support for Motion & Activity detection
- If your app asks for the Motion & Activity permission (for iOS) or the Activity Recognition permission (for Android) and the user grants it, you will have better activity detection in polylines
- Use new Activity service plugin `hypertrack-sdk-react-native-plugin-android-activity-service-google` (See [Plugins](https://hypertrack.com/docs/plugins))

### Changed

- Updated HyperTrack SDK iOS to [5.8.0](https://github.com/hypertrack/sdk-ios/releases/tag/5.8.0)
- Updated HyperTrack SDK Android to [7.8.0](https://github.com/hypertrack/sdk-android/releases/tag/7.8.0)

## [13.5.1] - 2024-09-02

### Fixed
Expand Down Expand Up @@ -922,3 +935,4 @@ Initial release.
[13.4.0]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.4.0
[13.5.0]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.5.0
[13.5.1]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.5.1
[13.6.0]: https://github.com/hypertrack/sdk-react-native/releases/tag/13.6.0
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Android
- Change `<plugin name>_HyperTrackSDKVersion` in:
- [sdk/android/gradle.properties](sdk/android/gradle.properties)
- [plugin_android_activity_service_google/android/gradle.properties](plugin_android_activity_service_google/android/gradle.properties)
- [plugin_android_location_services_google/android/gradle.properties](plugin_android_location_services_google/android/gradle.properties)
- [plugin_android_location_services_google_19_0_1/android/gradle.properties](plugin_android_location_services_google_19_0_1/android/gradle.properties)
- [plugin_android_push_service_firebase/android/gradle.properties](plugin_android_push_service_firebase/android/gradle.properties)
Expand All @@ -21,6 +22,7 @@
Change `version` value in:

- `hypertrack-sdk-react-native` version in [sdk/package.json](sdk/package.json)
- `hypertrack-sdk-react-native-plugin-android-activity-service-google` in [plugin_android_activity_service_google/package.json](plugin_android_activity_service_google/package.json)
- `hypertrack-sdk-react-native-plugin-android-location-services-google` in [plugin_android_location_services_google/package.json](plugin_android_location_services_google/package.json)
- `hypertrack-sdk-react-native-plugin-android-location-services-google-19-0-1` in [plugin_android_location_services_google_19_0_1/package.json](plugin_android_location_services_google_19_0_1/package.json)
- `hypertrack-sdk-react-native-plugin-android-push-service-firebase` in [plugin_android_push_service_firebase/package.json](plugin_android_push_service_firebase/package.json)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![GitHub](https://img.shields.io/github/license/hypertrack/sdk-react-native?color=orange)](./LICENSE)
[![npm](https://img.shields.io/npm/v/hypertrack-sdk-react-native.svg)](https://www.npmjs.com/package/hypertrack-sdk-react-native)
[![iOS SDK](https://img.shields.io/badge/iOS%20SDK-5.7.0-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
[![Android SDK](https://img.shields.io/badge/Android%20SDK-7.7.0-brightgreen.svg)](https://github.com/hypertrack/sdk-android)
[![iOS SDK](https://img.shields.io/badge/iOS%20SDK-5.8.0-brightgreen.svg)](https://github.com/hypertrack/sdk-ios)
[![Android SDK](https://img.shields.io/badge/Android%20SDK-7.8.0-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.

Expand Down
4 changes: 2 additions & 2 deletions docs/classes/HyperTrack.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/enums/HyperTrackError.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/modules.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Errors.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Failure.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Location.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/LocationError.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/LocationWithDeviation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/NotRunning.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Order.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/OrderStatus.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Result.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Starting.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/Success.html

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ _ask-confirm:

build: get-dependencies docs format
yarn --cwd sdk prepare
yarn --cwd plugin_android_activity_service_google prepare
yarn --cwd plugin_android_location_services_google prepare
yarn --cwd plugin_android_location_services_google_19_0_1 prepare
yarn --cwd plugin_android_push_service_firebase prepare
Expand All @@ -39,6 +40,7 @@ clean: _clear-node-modules

_clear-node-modules:
rm -rf sdk/node_modules
rm -rf plugin_android_activity_service_google/node_modules
rm -rf plugin_android_location_services_google/node_modules
rm -rf plugin_android_location_services_google_19_0_1/node_modules
rm -rf plugin_android_push_service_firebase/node_modules
Expand All @@ -51,6 +53,7 @@ docs: format

get-dependencies:
yarn --cwd sdk
yarn --cwd plugin_android_activity_service_google
yarn --cwd plugin_android_location_services_google
yarn --cwd plugin_android_location_services_google_19_0_1
yarn --cwd plugin_android_push_service_firebase
Expand Down Expand Up @@ -103,12 +106,14 @@ release publish="dry-run": build
echo "Are you sure you want to publish version $VERSION? (y/N)"
just _ask-confirm
cd sdk && npm publish && cd ..
cd plugin_android_activity_service_google && npm publish && cd ..
cd plugin_android_location_services_google && npm publish && cd ..
cd plugin_android_location_services_google_19_0_1 && npm publish && cd ..
cd plugin_android_push_service_firebase && npm publish && cd ..
open "https://www.npmjs.com/package/hypertrack-sdk-react-native/v/$VERSION"
else
cd sdk && npm publish --dry-run && cd ..
cd plugin_android_activity_service_google && npm publish --dry-run && cd ..
cd plugin_android_location_services_google && npm publish --dry-run && cd ..
cd plugin_android_location_services_google_19_0_1 && npm publish --dry-run && cd ..
cd plugin_android_push_service_firebase && npm publish --dry-run && cd ..
Expand Down Expand Up @@ -210,6 +215,7 @@ update-sdk-ios wrapper_version ios_version commit="true" branch="true": build
_update-sdk-android-version-file android_version:
./scripts/update_file.sh sdk/android/gradle.properties 'HyperTrackSdk_HyperTrackSDKVersion=.*' 'HyperTrackSdk_HyperTrackSDKVersion={{android_version}}'
./scripts/update_file.sh plugin_android_activity_service_google/android/gradle.properties 'PluginAndroidActivityServiceGoogle_HyperTrackSDKVersion=.*' 'PluginAndroidActivityServiceGoogle_HyperTrackSDKVersion={{android_version}}'
./scripts/update_file.sh plugin_android_location_services_google/android/gradle.properties 'PluginAndroidLocationServicesGoogle_HyperTrackSDKVersion=.*' 'PluginAndroidLocationServicesGoogle_HyperTrackSDKVersion={{android_version}}'
./scripts/update_file.sh plugin_android_location_services_google_19_0_1/android/gradle.properties 'PluginAndroidLocationServicesGoogle1901_HyperTrackSDKVersion=.*' 'PluginAndroidLocationServicesGoogle1901_HyperTrackSDKVersion={{android_version}}'
./scripts/update_file.sh plugin_android_push_service_firebase/android/gradle.properties 'PluginAndroidPushServiceFirebase_HyperTrackSDKVersion=.*' 'PluginAndroidPushServiceFirebase_HyperTrackSDKVersion={{android_version}}'
Expand All @@ -221,6 +227,7 @@ update-wrapper-version version: (_update-wrapper-version-file version)

_update-wrapper-version-file wrapper_version:
./scripts/update_file.sh sdk/package.json '"version": ".*"' '"version": "{{wrapper_version}}"'
./scripts/update_file.sh plugin_android_activity_service_google/package.json '"version": ".*"' '"version": "{{wrapper_version}}"'
./scripts/update_file.sh plugin_android_location_services_google/package.json '"version": ".*"' '"version": "{{wrapper_version}}"'
./scripts/update_file.sh plugin_android_location_services_google_19_0_1/package.json '"version": ".*"' '"version": "{{wrapper_version}}"'
./scripts/update_file.sh plugin_android_push_service_firebase/package.json '"version": ".*"' '"version": "{{wrapper_version}}"'
Expand Down
15 changes: 15 additions & 0 deletions plugin_android_activity_service_google/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions plugin_android_activity_service_google/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
78 changes: 78 additions & 0 deletions plugin_android_activity_service_google/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# OSX
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IJ
#
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml

# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Expo
.expo/

# Turborepo
.turbo/

# generated by bob
lib/
1 change: 1 addition & 0 deletions plugin_android_activity_service_google/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
1 change: 1 addition & 0 deletions plugin_android_activity_service_google/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
10 changes: 10 additions & 0 deletions plugin_android_activity_service_google/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
nodeLinker: node-modules
nmHoistingLimits: workspaces

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.6.1.cjs
1 change: 1 addition & 0 deletions plugin_android_activity_service_google/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# `hypertrack-sdk-react-native-plugin-android-activity-service-google`
97 changes: 97 additions & 0 deletions plugin_android_activity_service_google/android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
buildscript {
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["PluginAndroidActivityServiceGoogle_kotlinVersion"]

repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:7.2.1"
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}

apply plugin: "com.android.library"
apply plugin: "kotlin-android"

if (isNewArchitectureEnabled()) {
apply plugin: "com.facebook.react"
}

def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["PluginAndroidActivityServiceGoogle_" + name]
}

def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["PluginAndroidActivityServiceGoogle_" + name]).toInteger()
}

def supportsNamespace() {
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
def major = parsed[0].toInteger()
def minor = parsed[1].toInteger()

// Namespace support was added in 7.3.0
return (major == 7 && minor >= 3) || major >= 8
}

android {
if (supportsNamespace()) {
namespace "com.pluginandroidactivityservicegoogle"

sourceSets {
main {
manifest.srcFile "src/main/AndroidManifestNew.xml"
}
}
}

compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")

defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")

}

buildTypes {
release {
minifyEnabled false
}
}

lintOptions {
disable "GradleCompatible"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

repositories {
mavenCentral()
google()
}

def kotlin_version = getExtOrDefault("kotlinVersion")
def hyperTrackSdk_version = getExtOrDefault('HyperTrackSDKVersion')

dependencies {
// For < 0.71, this will be from the local maven repo
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

implementation "com.hypertrack:activity-service-google:$hyperTrackSdk_version"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PluginAndroidActivityServiceGoogle_kotlinVersion=1.7.0
PluginAndroidActivityServiceGoogle_minSdkVersion=21
PluginAndroidActivityServiceGoogle_targetSdkVersion=31
PluginAndroidActivityServiceGoogle_compileSdkVersion=31
PluginAndroidActivityServiceGoogle_ndkversion=21.4.7075529
PluginAndroidActivityServiceGoogle_HyperTrackSDKVersion=7.8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pluginandroidactivityservicegoogle">
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.pluginandroidactivityservicegoogle

import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.facebook.react.bridge.Promise

class PluginAndroidActivityServiceGoogleModule(reactContext: ReactApplicationContext) :
ReactContextBaseJavaModule(reactContext) {

override fun getName(): String {
return NAME
}

companion object {
const val NAME = "PluginAndroidActivityServiceGoogle"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.pluginandroidactivityservicegoogle

import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager


class PluginAndroidActivityServiceGooglePackage : ReactPackage {
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
return listOf(PluginAndroidActivityServiceGoogleModule(reactContext))
}

override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
return emptyList()
}
}
3 changes: 3 additions & 0 deletions plugin_android_activity_service_google/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
};
Loading

0 comments on commit 2e41325

Please sign in to comment.