Skip to content

Commit d59f990

Browse files
Implement Transitional API
Fix errors subscription callback param type. Fix `docgen` script. Update dependencies. Extract version variables in gradle.
1 parent 1d4ee21 commit d59f990

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+5561
-2975
lines changed

.gitignore

+66
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,63 @@
1+
# node files
2+
dist
3+
node_modules
4+
5+
# iOS files
6+
Pods
7+
Podfile.lock
8+
Build
9+
xcuserdata
10+
11+
# macOS files
12+
.DS_Store
13+
14+
# Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
15+
16+
# Built application files
17+
*.apk
18+
*.ap_
19+
20+
# Files for the ART/Dalvik VM
21+
*.dex
22+
23+
# Java class files
24+
*.class
25+
26+
# Generated files
27+
bin
28+
gen
29+
out
30+
31+
# Gradle files
32+
.gradle
33+
build
34+
35+
# Local configuration file (sdk path, etc)
36+
local.properties
37+
38+
# Proguard folder generated by Eclipse
39+
proguard
40+
41+
# Log Files
42+
*.log
43+
44+
# Android Studio Navigation editor temp files
45+
.navigation
46+
47+
# Android Studio captures folder
48+
captures
49+
50+
# IntelliJ
51+
*.iml
52+
.idea
53+
54+
# Keystore files
55+
# Uncomment the following line if you do not want to check your keystore files in.
56+
#*.jks
57+
58+
# External native build folder generated in Android Studio 2.2 and later
59+
.externalNativeBuild
60+
161
/.angular/cache
262
# Specifies intentionally untracked files to ignore when using Git
363
# http://git-scm.com/docs/gitignore
@@ -18,3 +78,9 @@ npm-debug.log*
1878
/plugins
1979
/www
2080
/.gradle
81+
82+
Pods
83+
Podfile.lock
84+
Build
85+
xcuserdata
86+
.DS_Store

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
6+
## [1.0.0] - 2023-02-10
7+
8+
#### Added
9+
- Initial release

CONTRIBUTING.md

+31-24
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,48 @@
11
# Contributing
22

3-
This guide provides instructions for contributing to this Capacitor plugin.
4-
5-
## Developing
6-
7-
### Local Setup
8-
9-
1. Fork and clone the repo.
10-
1. Install the dependencies.
11-
12-
```shell
13-
npm install
14-
```
15-
16-
1. Install SwiftLint if you're on macOS.
17-
18-
```shell
19-
brew install swiftlint
20-
```
21-
22-
### Scripts
23-
24-
#### `npm run build`
3+
## FAQ
4+
5+
### How to update HyperTrack SDK version and make a release?
6+
7+
1. Update SDK version constant
8+
- Android
9+
- `android/build.gradle`
10+
- `dependencies {}`
11+
- `com.hypertrack:hypertrack:<version>`
12+
- iOS
13+
- `HypertrackSdkIonicCapacitor.podspec`
14+
- `s.dependency 'HyperTrack'`
15+
16+
2. Increment wrapper version
17+
- `package.json`
18+
- `version`
19+
3. Update CHANGELOG.md
20+
4. Update badge in README.md
21+
5. Commit
22+
5. Create a version tag
23+
6. Push branch and tags
24+
7. Create a Github repo release
25+
- Release title should be the current version tag
26+
8. `npm release`
27+
9. `npm publish`
28+
29+
## Scripts
30+
31+
### `npm run build`
2532

2633
Build the plugin web assets and generate plugin API documentation using [`@capacitor/docgen`](https://github.com/ionic-team/capacitor-docgen).
2734

2835
It will compile the TypeScript code from `src/` into ESM JavaScript in `dist/esm/`. These files are used in apps with bundlers when your plugin is imported.
2936

3037
Then, Rollup will bundle the code into a single file at `dist/plugin.js`. This file is used in apps without bundlers by including it as a script in `index.html`.
3138

32-
#### `npm run verify`
39+
### `npm run verify`
3340

3441
Build and validate the web and native projects.
3542

3643
This is useful to run in CI to verify that the plugin builds for all platforms.
3744

38-
#### `npm run lint` / `npm run fmt`
45+
### `npm run lint` / `npm run fmt`
3946

4047
Check formatting and code quality, autoformat/autofix if possible.
4148

HypertrackCapacitorPlugin.podspec HypertrackSdkIonicCapacitor.podspec

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ require 'json'
33
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
44

55
Pod::Spec.new do |s|
6-
s.name = 'HypertrackCapacitorPlugin'
6+
s.name = 'HypertrackSdkIonicCapacitor'
77
s.version = package['version']
88
s.summary = package['description']
99
s.license = package['license']
@@ -14,4 +14,5 @@ Pod::Spec.new do |s|
1414
s.ios.deployment_target = '12.0'
1515
s.dependency 'Capacitor'
1616
s.swift_version = '5.1'
17+
s.dependency 'HyperTrack','4.14.0'
1718
end

LICENSE.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# License
2+
3+
MIT License
4+
5+
Copyright (c) 2022 HyperTrack
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.

README.md

+43-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,51 @@
1-
# hypertrack-capacitor-plugin
21

3-
Capacitor plugin for HyperTrack generation SDKs
2+
# Ionic Capacitor HyperTrack SDK
43

5-
## Install global dependencies
6-
```bash
7-
The base requirements are [Node](https://nodejs.org/en/) v8.6.0 or later, and NPM version 5.6.0 or later (which is usually automatically installed with the required version of Node).
4+
![GitHub](https://img.shields.io/github/license/hypertrack/sdk-ionic-capacitor.svg)
5+
![npm](https://img.shields.io/npm/v/hypertrack-sdk-ionic-capacitor.svg)
6+
![iOS SDK](https://img.shields.io/badge/iOS%20SDK-4.14.0-brightgreen.svg)
7+
![Android SDK](https://img.shields.io/badge/Android%20SDK-6.4.0-brightgreen.svg)
88

9-
npm install -g @capacitor/core @capacitor/cli
10-
```
9+
[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.
10+
11+
Ionic Capacitor HyperTrack SDK is a wrapper around native iOS and Android SDKs that allows to integrate HyperTrack into Ionic Capacitor apps.
12+
13+
For information about how to get started with Ionic Capacitor HyperTrack SDK, please check this [Guide](https://www.hypertrack.com/docs/install-sdk-ionic-capacitor).
14+
15+
## Installation
1116

12-
## Build plugin
17+
[Install from NPM](https://www.npmjs.com/package/hypertrack-sdk-ionic-capacitor)
1318

14-
```bash
15-
clone the repo [email protected]:hypertrack/sdk-ionic-capacitor.git
16-
cd sdk-ionic-capacitor/
17-
npm i
18-
npm run verify:android
19-
npm run build
19+
### Android
20+
In order to use this plugin, please add HyperTrack repository in `android/build.gradle`:
21+
22+
```
23+
allprojects {
24+
repositories {
25+
google()
26+
jcenter()
27+
maven {
28+
name 'hypertrack'
29+
url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
30+
}
31+
}
32+
}
2033
```
2134

22-
## Add plugin to Ionic app as a local dependency
35+
## Sample code
36+
37+
[Quickstart React Native app](https://github.com/hypertrack/quickstart-ionic-capacitor)
38+
39+
## Wrapper API Documentation
40+
41+
[Wrapper API Documentation](https://hypertrack.github.io/sdk-ionic-capacitor/)
42+
43+
## Requirements
44+
45+
### iOS
46+
47+
- iOS version 13.0+
48+
49+
## Contributing
2350

24-
```bash
25-
cd ionic-app/
26-
npm i <local-dir>/sdk-ionic-capacitor
27-
npx cap sync
28-
```
51+
If you want to contribute check [CONTRIBUTING.md](CONTRIBUTING.md)

android/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/build
22
/.idea
33
/.gradle
4+
local.properties

android/build.gradle

+17-11
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@ ext {
66
}
77

88
buildscript {
9+
ext.kotlin_version = "1.7.21"
10+
ext.hypertrack_sdk_version = "6.4.0"
11+
ext.firebase_messaging_version = "23.1.1"
12+
913
repositories {
1014
google()
1115
jcenter()
1216
}
1317
dependencies {
1418
classpath 'com.android.tools.build:gradle:4.2.1'
19+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
1520
}
1621
}
1722

1823
apply plugin: 'com.android.library'
24+
apply plugin: 'kotlin-android'
1925

2026
android {
2127
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
@@ -41,13 +47,15 @@ android {
4147
}
4248
}
4349

44-
repositories {
45-
google()
46-
mavenCentral()
47-
jcenter()
48-
maven {
49-
name 'hypertrack'
50-
url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
50+
allprojects {
51+
repositories {
52+
google()
53+
mavenCentral()
54+
jcenter()
55+
maven {
56+
name 'hypertrack'
57+
url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
58+
}
5159
}
5260
}
5361

@@ -56,8 +64,6 @@ dependencies {
5664
implementation fileTree(dir: 'libs', include: ['*.jar'])
5765
implementation project(':capacitor-android')
5866
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
59-
implementation 'com.hypertrack:hypertrack:6.2.0'
60-
testImplementation "junit:junit:$junitVersion"
61-
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
62-
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
67+
implementation "com.hypertrack:hypertrack:$hypertrack_sdk_version"
68+
implementation "com.google.firebase:firebase-messaging:$firebase_messaging_version"
6369
}

android/local.properties

-8
This file was deleted.

0 commit comments

Comments
 (0)