hypertrack-sdk-react-native 8.2.2 → 9.0.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.
Files changed (116) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/CONTRIBUTING.md +32 -110
  3. package/{LICENSE → LICENSE.md} +2 -0
  4. package/README.md +20 -40
  5. package/android/build.gradle +112 -113
  6. package/android/gradle.properties +1 -1
  7. package/android/src/main/java/com/reactnativehypertracksdk/HyperTrackReactNativePlugin.kt +209 -0
  8. package/android/src/main/java/com/reactnativehypertracksdk/HyperTrackSdkPackage.kt +2 -4
  9. package/android/src/main/java/com/reactnativehypertracksdk/ReactNativeSerialization.kt +88 -0
  10. package/android/src/main/java/com/reactnativehypertracksdk/common/Geotag.kt +9 -0
  11. package/android/src/main/java/com/reactnativehypertracksdk/common/HyperTrackError.kt +27 -0
  12. package/android/src/main/java/com/reactnativehypertracksdk/common/HyperTrackSdkWrapper.kt +243 -0
  13. package/android/src/main/java/com/reactnativehypertracksdk/common/LocationError.kt +9 -0
  14. package/android/src/main/java/com/reactnativehypertracksdk/common/Result.kt +48 -0
  15. package/android/src/main/java/com/reactnativehypertracksdk/common/SdkInitParams.kt +46 -0
  16. package/android/src/main/java/com/reactnativehypertracksdk/common/SdkMethod.kt +20 -0
  17. package/android/src/main/java/com/reactnativehypertracksdk/common/Serialization.kt +196 -0
  18. package/hypertrack-sdk-react-native.podspec +1 -1
  19. package/ios/HyperTrackReactNativePlugin.m +54 -0
  20. package/ios/HyperTrackReactNativePlugin.swift +253 -0
  21. package/ios/HyperTrackSdk-Bridging-Header.h +2 -0
  22. package/ios/HyperTrackSdk.xcodeproj/project.pbxproj +8 -11
  23. package/ios/common/DictionaryDecoder.swift +28 -0
  24. package/ios/common/HyperTrackError.swift +20 -0
  25. package/ios/common/HyperTrackSDKWrapper.swift +118 -0
  26. package/ios/common/SDKInitParams.swift +11 -0
  27. package/ios/common/SDKMethod.swift +14 -0
  28. package/ios/common/Serialization.swift +270 -0
  29. package/lib/commonjs/HyperTrack/HyperTrack.js +141 -142
  30. package/lib/commonjs/HyperTrack/HyperTrack.js.map +1 -1
  31. package/lib/commonjs/HyperTrack/data_types/HyperTrackError.js +31 -0
  32. package/lib/commonjs/HyperTrack/data_types/HyperTrackError.js.map +1 -0
  33. package/lib/commonjs/HyperTrack/data_types/Location.js +2 -0
  34. package/lib/commonjs/HyperTrack/data_types/Location.js.map +1 -0
  35. package/lib/commonjs/HyperTrack/data_types/LocationError.js +6 -0
  36. package/lib/commonjs/HyperTrack/data_types/LocationError.js.map +1 -0
  37. package/lib/commonjs/HyperTrack/data_types/SdkInitParams.js +2 -0
  38. package/lib/commonjs/HyperTrack/data_types/SdkInitParams.js.map +1 -0
  39. package/lib/commonjs/HyperTrack/data_types/internal/DeviceId.js +2 -0
  40. package/lib/commonjs/HyperTrack/data_types/internal/DeviceId.js.map +1 -0
  41. package/lib/commonjs/HyperTrack/data_types/internal/DeviceName.js +2 -0
  42. package/lib/commonjs/HyperTrack/data_types/internal/DeviceName.js.map +1 -0
  43. package/lib/commonjs/HyperTrack/data_types/internal/Geotag.js +2 -0
  44. package/lib/commonjs/HyperTrack/data_types/internal/Geotag.js.map +1 -0
  45. package/lib/commonjs/HyperTrack/data_types/internal/HyperTrackErrorInternal.js +2 -0
  46. package/lib/commonjs/HyperTrack/data_types/internal/HyperTrackErrorInternal.js.map +1 -0
  47. package/lib/commonjs/HyperTrack/data_types/internal/IsAvailable.js +2 -0
  48. package/lib/commonjs/HyperTrack/data_types/internal/IsAvailable.js.map +1 -0
  49. package/lib/commonjs/HyperTrack/data_types/internal/IsTracking.js +2 -0
  50. package/lib/commonjs/HyperTrack/data_types/internal/IsTracking.js.map +1 -0
  51. package/lib/commonjs/HyperTrack/data_types/internal/LocationErrorInternal.js +6 -0
  52. package/lib/commonjs/HyperTrack/data_types/internal/LocationErrorInternal.js.map +1 -0
  53. package/lib/commonjs/HyperTrack/data_types/internal/LocationResponse.js +6 -0
  54. package/lib/commonjs/HyperTrack/data_types/internal/LocationResponse.js.map +1 -0
  55. package/lib/commonjs/index.js +28 -17
  56. package/lib/commonjs/index.js.map +1 -1
  57. package/lib/module/HyperTrack/HyperTrack.js +140 -134
  58. package/lib/module/HyperTrack/HyperTrack.js.map +1 -1
  59. package/lib/module/HyperTrack/data_types/HyperTrackError.js +24 -0
  60. package/lib/module/HyperTrack/data_types/HyperTrackError.js.map +1 -0
  61. package/lib/module/HyperTrack/data_types/Location.js +2 -0
  62. package/lib/module/HyperTrack/data_types/Location.js.map +1 -0
  63. package/lib/module/HyperTrack/data_types/LocationError.js +2 -0
  64. package/lib/module/HyperTrack/data_types/LocationError.js.map +1 -0
  65. package/lib/module/HyperTrack/data_types/SdkInitParams.js +2 -0
  66. package/lib/module/HyperTrack/data_types/SdkInitParams.js.map +1 -0
  67. package/lib/module/HyperTrack/data_types/internal/DeviceId.js +2 -0
  68. package/lib/module/HyperTrack/data_types/internal/DeviceId.js.map +1 -0
  69. package/lib/module/HyperTrack/data_types/internal/DeviceName.js +2 -0
  70. package/lib/module/HyperTrack/data_types/internal/DeviceName.js.map +1 -0
  71. package/lib/module/HyperTrack/data_types/internal/Geotag.js +2 -0
  72. package/lib/module/HyperTrack/data_types/internal/Geotag.js.map +1 -0
  73. package/lib/module/HyperTrack/data_types/internal/HyperTrackErrorInternal.js +2 -0
  74. package/lib/module/HyperTrack/data_types/internal/HyperTrackErrorInternal.js.map +1 -0
  75. package/lib/module/HyperTrack/data_types/internal/IsAvailable.js +2 -0
  76. package/lib/module/HyperTrack/data_types/internal/IsAvailable.js.map +1 -0
  77. package/lib/module/HyperTrack/data_types/internal/IsTracking.js +2 -0
  78. package/lib/module/HyperTrack/data_types/internal/IsTracking.js.map +1 -0
  79. package/lib/module/HyperTrack/data_types/internal/LocationErrorInternal.js +2 -0
  80. package/lib/module/HyperTrack/data_types/internal/LocationErrorInternal.js.map +1 -0
  81. package/lib/module/HyperTrack/data_types/internal/LocationResponse.js +2 -0
  82. package/lib/module/HyperTrack/data_types/internal/LocationResponse.js.map +1 -0
  83. package/lib/module/index.js +4 -1
  84. package/lib/module/index.js.map +1 -1
  85. package/lib/typescript/HyperTrack/HyperTrack.d.ts +66 -100
  86. package/lib/typescript/HyperTrack/data_types/HyperTrackError.d.ts +20 -0
  87. package/lib/typescript/HyperTrack/data_types/Location.d.ts +7 -0
  88. package/lib/typescript/HyperTrack/data_types/LocationError.d.ts +8 -0
  89. package/lib/typescript/HyperTrack/data_types/SdkInitParams.d.ts +5 -0
  90. package/lib/typescript/HyperTrack/data_types/internal/DeviceId.d.ts +4 -0
  91. package/lib/typescript/HyperTrack/data_types/internal/DeviceName.d.ts +4 -0
  92. package/lib/typescript/HyperTrack/data_types/internal/Geotag.d.ts +3 -0
  93. package/lib/typescript/HyperTrack/data_types/internal/HyperTrackErrorInternal.d.ts +4 -0
  94. package/lib/typescript/HyperTrack/data_types/internal/IsAvailable.d.ts +4 -0
  95. package/lib/typescript/HyperTrack/data_types/internal/IsTracking.d.ts +4 -0
  96. package/lib/typescript/HyperTrack/data_types/internal/LocationErrorInternal.d.ts +12 -0
  97. package/lib/typescript/HyperTrack/data_types/internal/LocationResponse.d.ts +11 -0
  98. package/lib/typescript/index.d.ts +4 -1
  99. package/package.json +156 -156
  100. package/src/HyperTrack/HyperTrack.ts +163 -163
  101. package/src/HyperTrack/data_types/HyperTrackError.ts +22 -0
  102. package/src/HyperTrack/data_types/Location.ts +7 -0
  103. package/src/HyperTrack/data_types/LocationError.ts +11 -0
  104. package/src/HyperTrack/data_types/SdkInitParams.ts +5 -0
  105. package/src/HyperTrack/data_types/internal/DeviceId.ts +4 -0
  106. package/src/HyperTrack/data_types/internal/DeviceName.ts +4 -0
  107. package/src/HyperTrack/data_types/internal/Geotag.ts +3 -0
  108. package/src/HyperTrack/data_types/internal/HyperTrackErrorInternal.ts +4 -0
  109. package/src/HyperTrack/data_types/internal/IsAvailable.ts +4 -0
  110. package/src/HyperTrack/data_types/internal/IsTracking.ts +4 -0
  111. package/src/HyperTrack/data_types/internal/LocationErrorInternal.ts +14 -0
  112. package/src/HyperTrack/data_types/internal/LocationResponse.ts +14 -0
  113. package/src/index.tsx +4 -7
  114. package/android/src/main/java/com/reactnativehypertracksdk/HyperTrackModule.kt +0 -284
  115. package/ios/HyperTrack.h +0 -7
  116. package/ios/HyperTrack.m +0 -384
package/CHANGELOG.md CHANGED
@@ -1,9 +1,31 @@
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.0.0] - 2023-02-17
7
+
8
+ ### Changed
9
+ - Updated HyperTrack iOS SDK to 4.14.0
10
+ - Updated HyperTrack Android SDK to 6.4.0
11
+ - `createInstance()` renamed to `initialize()`
12
+ - `getDeviceID()` renamed to `getDeviceId()`
13
+ - `syncDeviceSettings()` renamed to `sync()`
14
+ - `setDeviceName()` renamed to `setName()`
15
+ - `subscribeToErrors()` callback now has param type (`HyperTrackError`)
16
+ - `LocationError` now has different structure
17
+
18
+ ### Added
19
+ - `initialize()` configuration params for
20
+ - Debug logging
21
+ - Background location permissions request for Android
22
+ - Mock locations
23
+ - `subscribeToAvailability()`
24
+
25
+ ### Removed
26
+ - `enableDebugLogging()` (use `initialize()` param `loggingEnabled` istead)
27
+ - `setTripMarker()` (use `addGeotag` instead)
28
+
7
29
  ## [8.2.2] - 2022-10-10
8
30
  ### Fixed
9
31
  - Deployment target for iOS changed to 11, to comply with native iOS SDK.
package/CONTRIBUTING.md CHANGED
@@ -1,6 +1,37 @@
1
1
  # Contributing
2
2
 
3
- We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.
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. 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. `yarn release`
27
+ - will generate docs
28
+ 9. `yarn npm publish`
29
+
30
+ ### How to change build config
31
+
32
+ #### Android
33
+
34
+ Change Android build config in `android/gradle.properties`
4
35
 
5
36
  ## Development workflow
6
37
 
@@ -25,37 +56,12 @@ To fix formatting errors, run the following:
25
56
  yarn lint --fix
26
57
  ```
27
58
 
28
- Remember to add tests for your change if possible. Run the unit tests by:
29
-
30
- ```sh
31
- yarn test
32
- ```
33
-
34
59
  ### Linting and tests
35
60
 
36
61
  [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
37
62
 
38
63
  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
64
 
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
65
  ### Sending a pull request
60
66
 
61
67
  > **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 +74,3 @@ When you're sending a pull request:
68
74
  - Follow the pull request template when opening a pull request.
69
75
  - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
70
76
 
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.
@@ -1,3 +1,5 @@
1
+ # License
2
+
1
3
  MIT License
2
4
 
3
5
  Copyright (c) 2019 HyperTrack
package/README.md CHANGED
@@ -1,59 +1,39 @@
1
1
  # React Native HyperTrack SDK
2
2
 
3
- ![GitHub](https://img.shields.io/github/license/hypertrack/sdk-react-native.svg) ![npm](https://img.shields.io/npm/v/hypertrack-sdk-react-native.svg) ![iOS SDK](https://img.shields.io/badge/iOS%20SDK-4.13.0-brightgreen.svg) ![Android SDK](https://img.shields.io/badge/Android%20SDK-6.3.0-brightgreen.svg)
3
+ ![GitHub](https://img.shields.io/github/license/hypertrack/sdk-react-native.svg)
4
+ ![npm](https://img.shields.io/npm/v/hypertrack-sdk-react-native.svg)
5
+ ![iOS SDK](https://img.shields.io/badge/iOS%20SDK-4.14.0-brightgreen.svg)
6
+ ![Android SDK](https://img.shields.io/badge/Android%20SDK-6.4.0-brightgreen.svg)
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 them into React Native apps.
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
- ## Installation
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
- ## FAQ
18
-
19
- link to FAQ
20
-
21
- ## Support
14
+ ## Installation
22
15
 
23
- Join our [Slack community](https://join.slack.com/t/hypertracksupport/shared_invite/enQtNDA0MDYxMzY1MDMxLTdmNDQ1ZDA1MTQxOTU2NTgwZTNiMzUyZDk0OThlMmJkNmE0ZGI2NGY2ZGRhYjY0Yzc0NTJlZWY2ZmE5ZTA2NjI) for instant responses. You can also email us at help@hypertrack.com.
16
+ [Install from NPM](https://www.npmjs.com/package/hypertrack-sdk-react-native)
24
17
 
25
- #### How to update the HyperTrack SDK version?
18
+ ## Sample code
26
19
 
27
- 1. Update SDK constant
20
+ [Quickstart React Native app](https://github.com/hypertrack/quickstart-react-native)
28
21
 
29
- - android
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
- 2. Increment wrapper version
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
- ### How to change build config
26
+ ## Requirements
47
27
 
48
- Change Android build config in `android/gradle.properties`
28
+ ### Android
49
29
 
50
- ### Old React Native versions specifics:
30
+ - Gradle version 6.7.1+
31
+ - compileSdkVersion 31+
51
32
 
52
- #### Android
33
+ ### iOS
53
34
 
54
- - Gradle version should be 6.7.1 or higher
55
- - compileSdkVersion should be 31 or higher
35
+ - iOS version 12.4+
56
36
 
57
- #### iOS
37
+ ## Contributing
58
38
 
59
- - Platform version should be 12.4 or higher
39
+ If you want to contribute check [CONTRIBUTING.md](CONTRIBUTING.md)
@@ -1,141 +1,141 @@
1
1
  buildscript {
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
- }
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
- return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
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
- apply plugin: 'com.facebook.react'
25
+ apply plugin: 'com.facebook.react'
26
26
  }
27
27
 
28
28
  def getExtOrDefault(name) {
29
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['HyperTrackSdk_' + name]
29
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['HyperTrackSdk_' + name]
30
30
  }
31
31
 
32
32
  def getExtOrIntegerDefault(name) {
33
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['HyperTrackSdk_' + name]).toInteger()
33
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['HyperTrackSdk_' + name]).toInteger()
34
34
  }
35
35
 
36
36
  android {
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
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
- repositories {
68
- mavenCentral()
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
- def found = false
76
- def defaultDir = null
77
- def androidSourcesName = 'React Native sources'
54
+ compileOptions {
55
+ sourceCompatibility JavaVersion.VERSION_1_8
56
+ targetCompatibility JavaVersion.VERSION_1_8
57
+ }
78
58
 
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
- }
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
- if (defaultDir.exists()) {
67
+ repositories {
68
+ mavenCentral()
69
+ google()
89
70
  maven {
90
- url defaultDir.toString()
91
- name androidSourcesName
71
+ name 'hypertrack'
72
+ url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
92
73
  }
93
74
 
94
- logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
95
- found = true
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
- )
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
- if (androidPrebuiltBinaryDir.exists()) {
88
+ if (defaultDir.exists()) {
114
89
  maven {
115
- url androidPrebuiltBinaryDir.toString()
116
- name androidSourcesName
90
+ url defaultDir.toString()
91
+ name androidSourcesName
117
92
  }
118
93
 
119
- logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
94
+ logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
120
95
  found = true
121
- } else if (androidSourcesDir.exists()) {
122
- maven {
123
- url androidSourcesDir.toString()
124
- name androidSourcesName
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
- logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
128
- found = true
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
- implementation "com.facebook.react:react-native:+"
147
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
148
- implementation "com.hypertrack:hypertrack:$hyperTrackSdk_version"
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
- react {
154
- jsRootDir = file("../src/")
155
- libraryName = "HyperTrackSdk"
156
- codegenJavaPackageName = "com.reactnativehypertracksdk"
157
- }
152
+ react {
153
+ jsRootDir = file("../src/")
154
+ libraryName = "HyperTrackSdk"
155
+ codegenJavaPackageName = "com.reactnativehypertracksdk"
156
+ }
158
157
  }
@@ -2,5 +2,5 @@ HyperTrackSdk_kotlinVersion=1.7.0
2
2
  HyperTrackSdk_minSdkVersion=23
3
3
  HyperTrackSdk_targetSdkVersion=30
4
4
  HyperTrackSdk_compileSdkVersion=31
5
- HyperTrackSdk_HyperTrackSDKVersion=6.3.0
5
+ HyperTrackSdk_HyperTrackSDKVersion=6.4.0
6
6
  android.useAndroidX=true