hypertrack-sdk-react-native 8.2.2 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -1
- package/CONTRIBUTING.md +30 -110
- package/LICENSE +2 -0
- package/README.md +20 -40
- package/android/build.gradle +112 -113
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativehypertracksdk/HyperTrackReactNativePlugin.kt +209 -0
- package/android/src/main/java/com/reactnativehypertracksdk/HyperTrackSdkPackage.kt +2 -4
- package/android/src/main/java/com/reactnativehypertracksdk/ReactNativeSerialization.kt +88 -0
- package/android/src/main/java/com/reactnativehypertracksdk/common/Geotag.kt +9 -0
- package/android/src/main/java/com/reactnativehypertracksdk/common/HyperTrackError.kt +28 -0
- package/android/src/main/java/com/reactnativehypertracksdk/common/HyperTrackSdkWrapper.kt +251 -0
- package/android/src/main/java/com/reactnativehypertracksdk/common/LocationError.kt +9 -0
- package/android/src/main/java/com/reactnativehypertracksdk/common/Result.kt +50 -0
- package/android/src/main/java/com/reactnativehypertracksdk/common/SdkInitParams.kt +44 -0
- package/android/src/main/java/com/reactnativehypertracksdk/common/SdkMethod.kt +21 -0
- package/android/src/main/java/com/reactnativehypertracksdk/common/Serialization.kt +203 -0
- package/hypertrack-sdk-react-native.podspec +1 -1
- package/ios/HyperTrackReactNativePlugin.m +54 -0
- package/ios/HyperTrackReactNativePlugin.swift +253 -0
- package/ios/HyperTrackSdk-Bridging-Header.h +2 -0
- package/ios/HyperTrackSdk.xcodeproj/project.pbxproj +8 -11
- package/ios/common/DictionaryDecoder.swift +28 -0
- package/ios/common/HyperTrackError.swift +20 -0
- package/ios/common/HyperTrackSDKWrapper.swift +120 -0
- package/ios/common/SDKInitParams.swift +13 -0
- package/ios/common/SDKMethod.swift +14 -0
- package/ios/common/Serialization.swift +268 -0
- package/lib/commonjs/HyperTrack/HyperTrack.js +142 -142
- package/lib/commonjs/HyperTrack/HyperTrack.js.map +1 -1
- package/lib/commonjs/HyperTrack/data_types/HyperTrackError.js +31 -0
- package/lib/commonjs/HyperTrack/data_types/HyperTrackError.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/Location.js +2 -0
- package/lib/commonjs/HyperTrack/data_types/Location.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/LocationError.js +6 -0
- package/lib/commonjs/HyperTrack/data_types/LocationError.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/SdkInitParams.js +2 -0
- package/lib/commonjs/HyperTrack/data_types/SdkInitParams.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/internal/DeviceId.js +2 -0
- package/lib/commonjs/HyperTrack/data_types/internal/DeviceId.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/internal/DeviceName.js +2 -0
- package/lib/commonjs/HyperTrack/data_types/internal/DeviceName.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/internal/Geotag.js +2 -0
- package/lib/commonjs/HyperTrack/data_types/internal/Geotag.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/internal/HyperTrackErrorInternal.js +2 -0
- package/lib/commonjs/HyperTrack/data_types/internal/HyperTrackErrorInternal.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/internal/IsAvailable.js +2 -0
- package/lib/commonjs/HyperTrack/data_types/internal/IsAvailable.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/internal/IsTracking.js +2 -0
- package/lib/commonjs/HyperTrack/data_types/internal/IsTracking.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/internal/LocationErrorInternal.js +6 -0
- package/lib/commonjs/HyperTrack/data_types/internal/LocationErrorInternal.js.map +1 -0
- package/lib/commonjs/HyperTrack/data_types/internal/LocationResponse.js +6 -0
- package/lib/commonjs/HyperTrack/data_types/internal/LocationResponse.js.map +1 -0
- package/lib/commonjs/index.js +28 -17
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/HyperTrack/HyperTrack.js +141 -134
- package/lib/module/HyperTrack/HyperTrack.js.map +1 -1
- package/lib/module/HyperTrack/data_types/HyperTrackError.js +24 -0
- package/lib/module/HyperTrack/data_types/HyperTrackError.js.map +1 -0
- package/lib/module/HyperTrack/data_types/Location.js +2 -0
- package/lib/module/HyperTrack/data_types/Location.js.map +1 -0
- package/lib/module/HyperTrack/data_types/LocationError.js +2 -0
- package/lib/module/HyperTrack/data_types/LocationError.js.map +1 -0
- package/lib/module/HyperTrack/data_types/SdkInitParams.js +2 -0
- package/lib/module/HyperTrack/data_types/SdkInitParams.js.map +1 -0
- package/lib/module/HyperTrack/data_types/internal/DeviceId.js +2 -0
- package/lib/module/HyperTrack/data_types/internal/DeviceId.js.map +1 -0
- package/lib/module/HyperTrack/data_types/internal/DeviceName.js +2 -0
- package/lib/module/HyperTrack/data_types/internal/DeviceName.js.map +1 -0
- package/lib/module/HyperTrack/data_types/internal/Geotag.js +2 -0
- package/lib/module/HyperTrack/data_types/internal/Geotag.js.map +1 -0
- package/lib/module/HyperTrack/data_types/internal/HyperTrackErrorInternal.js +2 -0
- package/lib/module/HyperTrack/data_types/internal/HyperTrackErrorInternal.js.map +1 -0
- package/lib/module/HyperTrack/data_types/internal/IsAvailable.js +2 -0
- package/lib/module/HyperTrack/data_types/internal/IsAvailable.js.map +1 -0
- package/lib/module/HyperTrack/data_types/internal/IsTracking.js +2 -0
- package/lib/module/HyperTrack/data_types/internal/IsTracking.js.map +1 -0
- package/lib/module/HyperTrack/data_types/internal/LocationErrorInternal.js +2 -0
- package/lib/module/HyperTrack/data_types/internal/LocationErrorInternal.js.map +1 -0
- package/lib/module/HyperTrack/data_types/internal/LocationResponse.js +2 -0
- package/lib/module/HyperTrack/data_types/internal/LocationResponse.js.map +1 -0
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/HyperTrack/HyperTrack.d.ts +66 -100
- package/lib/typescript/HyperTrack/data_types/HyperTrackError.d.ts +20 -0
- package/lib/typescript/HyperTrack/data_types/Location.d.ts +7 -0
- package/lib/typescript/HyperTrack/data_types/LocationError.d.ts +8 -0
- package/lib/typescript/HyperTrack/data_types/SdkInitParams.d.ts +25 -0
- package/lib/typescript/HyperTrack/data_types/internal/DeviceId.d.ts +4 -0
- package/lib/typescript/HyperTrack/data_types/internal/DeviceName.d.ts +4 -0
- package/lib/typescript/HyperTrack/data_types/internal/Geotag.d.ts +3 -0
- package/lib/typescript/HyperTrack/data_types/internal/HyperTrackErrorInternal.d.ts +4 -0
- package/lib/typescript/HyperTrack/data_types/internal/IsAvailable.d.ts +4 -0
- package/lib/typescript/HyperTrack/data_types/internal/IsTracking.d.ts +4 -0
- package/lib/typescript/HyperTrack/data_types/internal/LocationErrorInternal.d.ts +12 -0
- package/lib/typescript/HyperTrack/data_types/internal/LocationResponse.d.ts +11 -0
- package/lib/typescript/index.d.ts +4 -1
- package/package.json +156 -156
- package/src/HyperTrack/HyperTrack.ts +164 -163
- package/src/HyperTrack/data_types/HyperTrackError.ts +22 -0
- package/src/HyperTrack/data_types/Location.ts +7 -0
- package/src/HyperTrack/data_types/LocationError.ts +11 -0
- package/src/HyperTrack/data_types/SdkInitParams.ts +28 -0
- package/src/HyperTrack/data_types/internal/DeviceId.ts +4 -0
- package/src/HyperTrack/data_types/internal/DeviceName.ts +4 -0
- package/src/HyperTrack/data_types/internal/Geotag.ts +3 -0
- package/src/HyperTrack/data_types/internal/HyperTrackErrorInternal.ts +4 -0
- package/src/HyperTrack/data_types/internal/IsAvailable.ts +4 -0
- package/src/HyperTrack/data_types/internal/IsTracking.ts +4 -0
- package/src/HyperTrack/data_types/internal/LocationErrorInternal.ts +14 -0
- package/src/HyperTrack/data_types/internal/LocationResponse.ts +14 -0
- package/src/index.tsx +4 -7
- package/android/src/main/java/com/reactnativehypertracksdk/HyperTrackModule.kt +0 -284
- package/ios/HyperTrack.h +0 -7
- package/ios/HyperTrack.m +0 -384
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
-
All notable changes to this project will be documented in this file.
|
|
3
2
|
|
|
4
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
4
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
5
|
|
|
6
|
+
## [9.1.0] - 2023-03-21
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
- `automaticallyRequestPermissions` param to `initialize()`
|
|
10
|
+
|
|
11
|
+
## [9.0.0] - 2023-02-17
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Updated HyperTrack iOS SDK to 4.14.0
|
|
15
|
+
- Updated HyperTrack Android SDK to 6.4.0
|
|
16
|
+
- `createInstance()` renamed to `initialize()`
|
|
17
|
+
- `getDeviceID()` renamed to `getDeviceId()`
|
|
18
|
+
- `syncDeviceSettings()` renamed to `sync()`
|
|
19
|
+
- `setDeviceName()` renamed to `setName()`
|
|
20
|
+
- `subscribeToErrors()` callback now has param type (`HyperTrackError`)
|
|
21
|
+
- `LocationError` now has different structure
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- `initialize()` configuration params for
|
|
25
|
+
- Debug logging
|
|
26
|
+
- Background location permissions request for Android
|
|
27
|
+
- Mock locations
|
|
28
|
+
- `subscribeToAvailability()`
|
|
29
|
+
|
|
30
|
+
### Removed
|
|
31
|
+
- `automaticallyRequestPermissions` param from `initialize()`
|
|
32
|
+
- `enableDebugLogging()` (use `initialize()` param `loggingEnabled` istead)
|
|
33
|
+
- `setTripMarker()` (use `addGeotag` instead)
|
|
34
|
+
|
|
7
35
|
## [8.2.2] - 2022-10-10
|
|
8
36
|
### Fixed
|
|
9
37
|
- Deployment target for iOS changed to 11, to comply with native iOS SDK.
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## FAQ
|
|
4
|
+
|
|
5
|
+
### How to update the HyperTrack SDK version and make a release?
|
|
6
|
+
|
|
7
|
+
1. Update SDK version constant
|
|
8
|
+
- android
|
|
9
|
+
- android/gradle.properties - HyperTrackSdk_HyperTrackSDKVersion
|
|
10
|
+
- ios
|
|
11
|
+
- hypertrack-sdk-react-native.podspec
|
|
12
|
+
- s.dependency 'HyperTrack/Objective-C', '**version**'
|
|
13
|
+
|
|
14
|
+
2. Increment wrapper version
|
|
15
|
+
|
|
16
|
+
- package.json
|
|
17
|
+
- version
|
|
18
|
+
|
|
19
|
+
3. Update CHANGELOG.md
|
|
20
|
+
4. Update badge in README.md
|
|
21
|
+
5. Do the release dry run with `just release` and verify that the release is correct (checklist is in the command output)
|
|
22
|
+
6. Commit and merge to master
|
|
23
|
+
7. Create and push a new version tag
|
|
24
|
+
8. Run `npm publish` to publish the package to npm
|
|
25
|
+
9. Create a Github repo release
|
|
26
|
+
- Release title should be the current version tag
|
|
27
|
+
|
|
28
|
+
### How to change build config
|
|
29
|
+
|
|
30
|
+
#### Android
|
|
31
|
+
|
|
32
|
+
Change Android build config in `android/gradle.properties`
|
|
4
33
|
|
|
5
34
|
## Development workflow
|
|
6
35
|
|
|
@@ -25,37 +54,12 @@ To fix formatting errors, run the following:
|
|
|
25
54
|
yarn lint --fix
|
|
26
55
|
```
|
|
27
56
|
|
|
28
|
-
Remember to add tests for your change if possible. Run the unit tests by:
|
|
29
|
-
|
|
30
|
-
```sh
|
|
31
|
-
yarn test
|
|
32
|
-
```
|
|
33
|
-
|
|
34
57
|
### Linting and tests
|
|
35
58
|
|
|
36
59
|
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
|
|
37
60
|
|
|
38
61
|
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
|
|
39
62
|
|
|
40
|
-
### Publishing to npm
|
|
41
|
-
|
|
42
|
-
We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
|
|
43
|
-
|
|
44
|
-
To publish new versions, run the following:
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
yarn release
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Scripts
|
|
51
|
-
|
|
52
|
-
The `package.json` file contains various scripts for common tasks:
|
|
53
|
-
|
|
54
|
-
- `yarn bootstrap`: setup project by installing all dependencies.
|
|
55
|
-
- `yarn typescript`: type-check files with TypeScript.
|
|
56
|
-
- `yarn lint`: lint files with ESLint.
|
|
57
|
-
- `yarn test`: run unit tests with Jest.
|
|
58
|
-
|
|
59
63
|
### Sending a pull request
|
|
60
64
|
|
|
61
65
|
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
|
|
@@ -68,87 +72,3 @@ When you're sending a pull request:
|
|
|
68
72
|
- Follow the pull request template when opening a pull request.
|
|
69
73
|
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
|
|
70
74
|
|
|
71
|
-
## Code of Conduct
|
|
72
|
-
|
|
73
|
-
### Our Pledge
|
|
74
|
-
|
|
75
|
-
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
76
|
-
|
|
77
|
-
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
78
|
-
|
|
79
|
-
### Our Standards
|
|
80
|
-
|
|
81
|
-
Examples of behavior that contributes to a positive environment for our community include:
|
|
82
|
-
|
|
83
|
-
- Demonstrating empathy and kindness toward other people
|
|
84
|
-
- Being respectful of differing opinions, viewpoints, and experiences
|
|
85
|
-
- Giving and gracefully accepting constructive feedback
|
|
86
|
-
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
87
|
-
- Focusing on what is best not just for us as individuals, but for the overall community
|
|
88
|
-
|
|
89
|
-
Examples of unacceptable behavior include:
|
|
90
|
-
|
|
91
|
-
- The use of sexualized language or imagery, and sexual attention or
|
|
92
|
-
advances of any kind
|
|
93
|
-
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
94
|
-
- Public or private harassment
|
|
95
|
-
- Publishing others' private information, such as a physical or email
|
|
96
|
-
address, without their explicit permission
|
|
97
|
-
- Other conduct which could reasonably be considered inappropriate in a
|
|
98
|
-
professional setting
|
|
99
|
-
|
|
100
|
-
### Enforcement Responsibilities
|
|
101
|
-
|
|
102
|
-
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
103
|
-
|
|
104
|
-
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
105
|
-
|
|
106
|
-
### Scope
|
|
107
|
-
|
|
108
|
-
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
109
|
-
|
|
110
|
-
### Enforcement
|
|
111
|
-
|
|
112
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
|
|
113
|
-
|
|
114
|
-
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
115
|
-
|
|
116
|
-
### Enforcement Guidelines
|
|
117
|
-
|
|
118
|
-
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
119
|
-
|
|
120
|
-
#### 1. Correction
|
|
121
|
-
|
|
122
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
123
|
-
|
|
124
|
-
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
125
|
-
|
|
126
|
-
#### 2. Warning
|
|
127
|
-
|
|
128
|
-
**Community Impact**: A violation through a single incident or series of actions.
|
|
129
|
-
|
|
130
|
-
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
131
|
-
|
|
132
|
-
#### 3. Temporary Ban
|
|
133
|
-
|
|
134
|
-
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
135
|
-
|
|
136
|
-
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
137
|
-
|
|
138
|
-
#### 4. Permanent Ban
|
|
139
|
-
|
|
140
|
-
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
141
|
-
|
|
142
|
-
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
143
|
-
|
|
144
|
-
### Attribution
|
|
145
|
-
|
|
146
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
|
147
|
-
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
148
|
-
|
|
149
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
|
150
|
-
|
|
151
|
-
[homepage]: https://www.contributor-covenant.org
|
|
152
|
-
|
|
153
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
154
|
-
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,59 +1,39 @@
|
|
|
1
1
|
# React Native HyperTrack SDK
|
|
2
2
|
|
|
3
|
-

|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
4
7
|
|
|
5
8
|
[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.
|
|
6
9
|
|
|
7
|
-
React Native HyperTrack SDK is a wrapper around native iOS and Android SDKs that allows to integrate
|
|
10
|
+
React Native HyperTrack SDK is a wrapper around native iOS and Android SDKs that allows to integrate HyperTrack into React Native apps.
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
For information about how to get started with React Native SDK, please visit this [HyperTrack Guide](https://www.hypertrack.com/docs/install-sdk-react-native).
|
|
12
|
-
|
|
13
|
-
## Documentation
|
|
14
|
-
|
|
15
|
-
[https://hypertrack.github.io/sdk-react-native/](https://hypertrack.github.io/sdk-react-native/)
|
|
12
|
+
For information about how to get started with React Native HyperTrack SDK, please check this [Guide](https://www.hypertrack.com/docs/install-sdk-react-native).
|
|
16
13
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
link to FAQ
|
|
20
|
-
|
|
21
|
-
## Support
|
|
14
|
+
## Installation
|
|
22
15
|
|
|
23
|
-
|
|
16
|
+
`yarn add hypertrack-sdk-react-native`
|
|
24
17
|
|
|
25
|
-
|
|
18
|
+
## Sample code
|
|
26
19
|
|
|
27
|
-
|
|
20
|
+
[Quickstart React Native app](https://github.com/hypertrack/quickstart-react-native)
|
|
28
21
|
|
|
29
|
-
|
|
30
|
-
- android/gradle.properties - HyperTrackSdk_HyperTrackSDKVersion
|
|
31
|
-
- ios
|
|
32
|
-
- hypertrack-sdk-react-native.podspec
|
|
33
|
-
- s.dependency 'HyperTrack/Objective-C', '**version**'
|
|
22
|
+
## Wrapper API Documentation
|
|
34
23
|
|
|
35
|
-
|
|
36
|
-
- package.json
|
|
37
|
-
- version
|
|
38
|
-
3. Update changelog
|
|
39
|
-
4. Update badge in README.md
|
|
40
|
-
5. Create a version tag
|
|
41
|
-
6. Commit and push
|
|
42
|
-
7. Create a release
|
|
43
|
-
- Release title should be the current version tag
|
|
44
|
-
8. npm publish
|
|
24
|
+
[Wrapper API Documentation](https://hypertrack.github.io/sdk-react-native/)
|
|
45
25
|
|
|
46
|
-
|
|
26
|
+
## Requirements
|
|
47
27
|
|
|
48
|
-
|
|
28
|
+
### Android
|
|
49
29
|
|
|
50
|
-
|
|
30
|
+
- Gradle version 6.7.1+
|
|
31
|
+
- compileSdkVersion 31+
|
|
51
32
|
|
|
52
|
-
|
|
33
|
+
### iOS
|
|
53
34
|
|
|
54
|
-
-
|
|
55
|
-
- compileSdkVersion should be 31 or higher
|
|
35
|
+
- iOS version 12.4+
|
|
56
36
|
|
|
57
|
-
|
|
37
|
+
## Contributing
|
|
58
38
|
|
|
59
|
-
|
|
39
|
+
If you want to contribute check [CONTRIBUTING.md](CONTRIBUTING.md)
|
package/android/build.gradle
CHANGED
|
@@ -1,141 +1,141 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
+
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['HyperTrackSdk_kotlinVersion']
|
|
4
|
+
|
|
5
|
+
repositories {
|
|
6
|
+
google()
|
|
7
|
+
mavenCentral()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dependencies {
|
|
11
|
+
classpath 'com.android.tools.build:gradle:7.1.2'
|
|
12
|
+
// noinspection DifferentKotlinGradleVersion
|
|
13
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
|
+
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
def isNewArchitectureEnabled() {
|
|
18
|
-
|
|
18
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
apply plugin: 'com.android.library'
|
|
22
22
|
apply plugin: 'kotlin-android'
|
|
23
23
|
|
|
24
24
|
if (isNewArchitectureEnabled()) {
|
|
25
|
-
|
|
25
|
+
apply plugin: 'com.facebook.react'
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
def getExtOrDefault(name) {
|
|
29
|
-
|
|
29
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['HyperTrackSdk_' + name]
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
def getExtOrIntegerDefault(name) {
|
|
33
|
-
|
|
33
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['HyperTrackSdk_' + name]).toInteger()
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
android {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
38
|
+
|
|
39
|
+
defaultConfig {
|
|
40
|
+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
41
|
+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
42
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
43
|
+
}
|
|
44
|
+
buildTypes {
|
|
45
|
+
release {
|
|
46
|
+
minifyEnabled false
|
|
47
|
+
}
|
|
47
48
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
lintOptions {
|
|
51
|
-
disable 'GradleCompatible'
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
compileOptions {
|
|
55
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
56
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
packagingOptions {
|
|
60
|
-
pickFirst 'lib/x86/libc++_shared.so'
|
|
61
|
-
pickFirst 'lib/x86_64/libc++_shared.so'
|
|
62
|
-
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
|
63
|
-
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
49
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
google()
|
|
70
|
-
maven {
|
|
71
|
-
name 'hypertrack'
|
|
72
|
-
url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
|
|
50
|
+
lintOptions {
|
|
51
|
+
disable 'GradleCompatible'
|
|
73
52
|
}
|
|
74
53
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
54
|
+
compileOptions {
|
|
55
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
56
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
57
|
+
}
|
|
78
58
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
59
|
+
packagingOptions {
|
|
60
|
+
pickFirst 'lib/x86/libc++_shared.so'
|
|
61
|
+
pickFirst 'lib/x86_64/libc++_shared.so'
|
|
62
|
+
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
|
63
|
+
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
87
66
|
|
|
88
|
-
|
|
67
|
+
repositories {
|
|
68
|
+
mavenCentral()
|
|
69
|
+
google()
|
|
89
70
|
maven {
|
|
90
|
-
|
|
91
|
-
|
|
71
|
+
name 'hypertrack'
|
|
72
|
+
url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
|
|
92
73
|
}
|
|
93
74
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
)
|
|
107
|
-
|
|
108
|
-
def androidPrebuiltBinaryDir = new File(
|
|
109
|
-
parentDir,
|
|
110
|
-
'node_modules/react-native/android'
|
|
111
|
-
)
|
|
75
|
+
def found = false
|
|
76
|
+
def defaultDir = null
|
|
77
|
+
def androidSourcesName = 'React Native sources'
|
|
78
|
+
|
|
79
|
+
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
|
80
|
+
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
|
81
|
+
} else {
|
|
82
|
+
defaultDir = new File(
|
|
83
|
+
projectDir,
|
|
84
|
+
'/../../../node_modules/react-native/android'
|
|
85
|
+
)
|
|
86
|
+
}
|
|
112
87
|
|
|
113
|
-
|
|
88
|
+
if (defaultDir.exists()) {
|
|
114
89
|
maven {
|
|
115
|
-
|
|
116
|
-
|
|
90
|
+
url defaultDir.toString()
|
|
91
|
+
name androidSourcesName
|
|
117
92
|
}
|
|
118
93
|
|
|
119
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${
|
|
94
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
|
|
120
95
|
found = true
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
96
|
+
} else {
|
|
97
|
+
def parentDir = rootProject.projectDir
|
|
98
|
+
|
|
99
|
+
1.upto(5, {
|
|
100
|
+
if (found) return true
|
|
101
|
+
parentDir = parentDir.parentFile
|
|
102
|
+
|
|
103
|
+
def androidSourcesDir = new File(
|
|
104
|
+
parentDir,
|
|
105
|
+
'node_modules/react-native'
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
def androidPrebuiltBinaryDir = new File(
|
|
109
|
+
parentDir,
|
|
110
|
+
'node_modules/react-native/android'
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
if (androidPrebuiltBinaryDir.exists()) {
|
|
114
|
+
maven {
|
|
115
|
+
url androidPrebuiltBinaryDir.toString()
|
|
116
|
+
name androidSourcesName
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
|
|
120
|
+
found = true
|
|
121
|
+
} else if (androidSourcesDir.exists()) {
|
|
122
|
+
maven {
|
|
123
|
+
url androidSourcesDir.toString()
|
|
124
|
+
name androidSourcesName
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
|
|
128
|
+
found = true
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
}
|
|
126
132
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (!found) {
|
|
134
|
-
throw new GradleException(
|
|
135
|
-
"${project.name}: unable to locate React Native android sources. " +
|
|
136
|
-
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
137
|
-
)
|
|
138
|
-
}
|
|
133
|
+
if (!found) {
|
|
134
|
+
throw new GradleException(
|
|
135
|
+
"${project.name}: unable to locate React Native android sources. " +
|
|
136
|
+
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
@@ -143,16 +143,15 @@ def hyperTrackSdk_version = getExtOrDefault('HyperTrackSDKVersion')
|
|
|
143
143
|
|
|
144
144
|
dependencies {
|
|
145
145
|
//noinspection GradleDynamicVersion
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
// From node_modules
|
|
146
|
+
implementation "com.facebook.react:react-native:+"
|
|
147
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
148
|
+
implementation "com.hypertrack:hypertrack:$hyperTrackSdk_version"
|
|
150
149
|
}
|
|
151
150
|
|
|
152
151
|
if (isNewArchitectureEnabled()) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
react {
|
|
153
|
+
jsRootDir = file("../src/")
|
|
154
|
+
libraryName = "HyperTrackSdk"
|
|
155
|
+
codegenJavaPackageName = "com.reactnativehypertracksdk"
|
|
156
|
+
}
|
|
158
157
|
}
|