Skip to content

Commit

Permalink
Implement Transitional API
Browse files Browse the repository at this point in the history
Fix errors subscription callback param type.
Fix `docgen` script.
Update dependencies.
Extract version variables in gradle.
  • Loading branch information
pavel-kuznetsov-hypertrack committed Feb 23, 2023
1 parent 1d4ee21 commit d59f990
Show file tree
Hide file tree
Showing 73 changed files with 5,561 additions and 2,975 deletions.
66 changes: 66 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
# node files
dist
node_modules

# iOS files
Pods
Podfile.lock
Build
xcuserdata

# macOS files
.DS_Store

# Based on Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore

# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin
gen
out

# Gradle files
.gradle
build

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation

# Android Studio captures folder
captures

# IntelliJ
*.iml
.idea

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

/.angular/cache
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
Expand All @@ -18,3 +78,9 @@ npm-debug.log*
/plugins
/www
/.gradle

Pods
Podfile.lock
Build
xcuserdata
.DS_Store
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

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).

## [1.0.0] - 2023-02-10

#### Added
- Initial release
55 changes: 31 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
# Contributing

This guide provides instructions for contributing to this Capacitor plugin.

## Developing

### Local Setup

1. Fork and clone the repo.
1. Install the dependencies.

```shell
npm install
```

1. Install SwiftLint if you're on macOS.
```shell
brew install swiftlint
```
### Scripts
#### `npm run build`
## FAQ

### How to update HyperTrack SDK version and make a release?

1. Update SDK version constant
- Android
- `android/build.gradle`
- `dependencies {}`
- `com.hypertrack:hypertrack:<version>`
- iOS
- `HypertrackSdkIonicCapacitor.podspec`
- `s.dependency 'HyperTrack'`

2. Increment wrapper version
- `package.json`
- `version`
3. Update CHANGELOG.md
4. Update badge in README.md
5. Commit
5. Create a version tag
6. Push branch and tags
7. Create a Github repo release
- Release title should be the current version tag
8. `npm release`
9. `npm publish`

## Scripts

### `npm run build`

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

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.

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`.

#### `npm run verify`
### `npm run verify`

Build and validate the web and native projects.

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

#### `npm run lint` / `npm run fmt`
### `npm run lint` / `npm run fmt`

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = 'HypertrackCapacitorPlugin'
s.name = 'HypertrackSdkIonicCapacitor'
s.version = package['version']
s.summary = package['description']
s.license = package['license']
Expand All @@ -14,4 +14,5 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '12.0'
s.dependency 'Capacitor'
s.swift_version = '5.1'
s.dependency 'HyperTrack','4.14.0'
end
23 changes: 23 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# License

MIT License

Copyright (c) 2022 HyperTrack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
63 changes: 43 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@
# hypertrack-capacitor-plugin

Capacitor plugin for HyperTrack generation SDKs
# Ionic Capacitor HyperTrack SDK

## Install global dependencies
```bash
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).
![GitHub](https://img.shields.io/github/license/hypertrack/sdk-ionic-capacitor.svg)
![npm](https://img.shields.io/npm/v/hypertrack-sdk-ionic-capacitor.svg)
![iOS SDK](https://img.shields.io/badge/iOS%20SDK-4.14.0-brightgreen.svg)
![Android SDK](https://img.shields.io/badge/Android%20SDK-6.4.0-brightgreen.svg)

npm install -g @capacitor/core @capacitor/cli
```
[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.

Ionic Capacitor HyperTrack SDK is a wrapper around native iOS and Android SDKs that allows to integrate HyperTrack into Ionic Capacitor apps.

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).

## Installation

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

```bash
clone the repo [email protected]:hypertrack/sdk-ionic-capacitor.git
cd sdk-ionic-capacitor/
npm i
npm run verify:android
npm run build
### Android
In order to use this plugin, please add HyperTrack repository in `android/build.gradle`:

```
allprojects {
repositories {
google()
jcenter()
maven {
name 'hypertrack'
url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
}
}
}
```

## Add plugin to Ionic app as a local dependency
## Sample code

[Quickstart React Native app](https://github.com/hypertrack/quickstart-ionic-capacitor)

## Wrapper API Documentation

[Wrapper API Documentation](https://hypertrack.github.io/sdk-ionic-capacitor/)

## Requirements

### iOS

- iOS version 13.0+

## Contributing

```bash
cd ionic-app/
npm i <local-dir>/sdk-ionic-capacitor
npx cap sync
```
If you want to contribute check [CONTRIBUTING.md](CONTRIBUTING.md)
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/build
/.idea
/.gradle
local.properties
28 changes: 17 additions & 11 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@ ext {
}

buildscript {
ext.kotlin_version = "1.7.21"
ext.hypertrack_sdk_version = "6.4.0"
ext.firebase_messaging_version = "23.1.1"

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
}
}

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

android {
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
Expand All @@ -41,13 +47,15 @@ android {
}
}

repositories {
google()
mavenCentral()
jcenter()
maven {
name 'hypertrack'
url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
name 'hypertrack'
url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
}
}
}

Expand All @@ -56,8 +64,6 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':capacitor-android')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation 'com.hypertrack:hypertrack:6.2.0'
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation "com.hypertrack:hypertrack:$hypertrack_sdk_version"
implementation "com.google.firebase:firebase-messaging:$firebase_messaging_version"
}
8 changes: 0 additions & 8 deletions android/local.properties

This file was deleted.

Loading

0 comments on commit d59f990

Please sign in to comment.