react-native-nitro-geolocation 1.2.4 → 1.2.6

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 (94) hide show
  1. package/README.md +26 -6
  2. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocation.kt +10 -10
  3. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocationCompat.kt +4 -4
  4. package/ios/NitroGeolocation.swift +10 -10
  5. package/ios/NitroGeolocationCompat.swift +6 -4
  6. package/nitrogen/generated/android/c++/JAccuracyAuthorization.hpp +1 -1
  7. package/nitrogen/generated/android/c++/JAndroidAccuracyPreset.hpp +1 -1
  8. package/nitrogen/generated/android/c++/JAndroidGranularity.hpp +1 -1
  9. package/nitrogen/generated/android/c++/JAuthorizationLevel.hpp +1 -1
  10. package/nitrogen/generated/android/c++/JAuthorizationLevelInternal.hpp +1 -1
  11. package/nitrogen/generated/android/c++/JCompatGeolocationConfigurationInternal.hpp +1 -1
  12. package/nitrogen/generated/android/c++/JCompatGeolocationError.hpp +1 -1
  13. package/nitrogen/generated/android/c++/JCompatGeolocationOptions.hpp +1 -1
  14. package/nitrogen/generated/android/c++/JCompatGeolocationResponse.hpp +1 -1
  15. package/nitrogen/generated/android/c++/JFunc_void.hpp +2 -2
  16. package/nitrogen/generated/android/c++/JFunc_void_AccuracyAuthorization.hpp +2 -2
  17. package/nitrogen/generated/android/c++/JFunc_void_CompatGeolocationError.hpp +2 -2
  18. package/nitrogen/generated/android/c++/JFunc_void_CompatGeolocationResponse.hpp +2 -2
  19. package/nitrogen/generated/android/c++/JFunc_void_GeolocationResponse.hpp +2 -2
  20. package/nitrogen/generated/android/c++/JFunc_void_Heading.hpp +2 -2
  21. package/nitrogen/generated/android/c++/JFunc_void_LocationError.hpp +2 -2
  22. package/nitrogen/generated/android/c++/JFunc_void_LocationProviderStatus.hpp +2 -2
  23. package/nitrogen/generated/android/c++/JFunc_void_PermissionStatus.hpp +2 -2
  24. package/nitrogen/generated/android/c++/JFunc_void_std__vector_GeocodedLocation_.hpp +16 -16
  25. package/nitrogen/generated/android/c++/JFunc_void_std__vector_ReverseGeocodedAddress_.hpp +16 -16
  26. package/nitrogen/generated/android/c++/JGeocodedLocation.hpp +1 -1
  27. package/nitrogen/generated/android/c++/JGeocodingCoordinates.hpp +1 -1
  28. package/nitrogen/generated/android/c++/JGeolocationConfiguration.hpp +1 -1
  29. package/nitrogen/generated/android/c++/JGeolocationCoordinates.hpp +1 -1
  30. package/nitrogen/generated/android/c++/JGeolocationResponse.hpp +1 -1
  31. package/nitrogen/generated/android/c++/JHeading.hpp +1 -1
  32. package/nitrogen/generated/android/c++/JHeadingOptions.hpp +1 -1
  33. package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.cpp +6 -6
  34. package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.hpp +4 -4
  35. package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.cpp +15 -15
  36. package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.hpp +7 -7
  37. package/nitrogen/generated/android/c++/JIOSAccuracyPreset.hpp +1 -1
  38. package/nitrogen/generated/android/c++/JIOSActivityType.hpp +1 -1
  39. package/nitrogen/generated/android/c++/JLocationAccuracyOptions.hpp +1 -1
  40. package/nitrogen/generated/android/c++/JLocationAvailability.hpp +1 -1
  41. package/nitrogen/generated/android/c++/JLocationError.hpp +1 -1
  42. package/nitrogen/generated/android/c++/JLocationProvider.hpp +1 -1
  43. package/nitrogen/generated/android/c++/JLocationProviderInternal.hpp +1 -1
  44. package/nitrogen/generated/android/c++/JLocationProviderStatus.hpp +1 -1
  45. package/nitrogen/generated/android/c++/JLocationProviderUsed.hpp +1 -1
  46. package/nitrogen/generated/android/c++/JLocationRequestOptions.hpp +1 -1
  47. package/nitrogen/generated/android/c++/JLocationSettingsOptions.hpp +1 -1
  48. package/nitrogen/generated/android/c++/JNullableDouble.hpp +3 -3
  49. package/nitrogen/generated/android/c++/JPermissionStatus.hpp +1 -1
  50. package/nitrogen/generated/android/c++/JReverseGeocodedAddress.hpp +1 -1
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationConfigurationInternal.kt +19 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationError.kt +21 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationOptions.kt +33 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationResponse.kt +15 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeocodedLocation.kt +17 -0
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeocodingCoordinates.kt +15 -0
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationConfiguration.kt +19 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationCoordinates.kt +25 -0
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationResponse.kt +19 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Heading.kt +19 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HeadingOptions.kt +13 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationCompatSpec.kt +6 -6
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationSpec.kt +15 -15
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationAccuracyOptions.kt +15 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationAvailability.kt +15 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationError.kt +15 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationProviderStatus.kt +23 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationRequestOptions.kt +43 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationSettingsOptions.kt +25 -0
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/NullableDouble.kt +16 -7
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/ReverseGeocodedAddress.kt +25 -0
  72. package/nitrogen/generated/android/nitrogeolocationOnLoad.cpp +4 -4
  73. package/nitrogen/generated/ios/NitroGeolocation+autolinking.rb +2 -0
  74. package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.hpp +0 -72
  75. package/nitrogen/generated/ios/c++/HybridNitroGeolocationCompatSpecSwift.hpp +4 -4
  76. package/nitrogen/generated/ios/c++/HybridNitroGeolocationSpecSwift.hpp +10 -10
  77. package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec.swift +2 -2
  78. package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec_cxx.swift +6 -6
  79. package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec.swift +5 -5
  80. package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec_cxx.swift +15 -15
  81. package/nitrogen/generated/ios/swift/NullableDouble.swift +12 -0
  82. package/nitrogen/generated/shared/c++/HybridNitroGeolocationCompatSpec.hpp +2 -2
  83. package/nitrogen/generated/shared/c++/HybridNitroGeolocationSpec.hpp +5 -5
  84. package/package.json +2 -1
  85. package/src/NitroGeolocation.nitro.ts +10 -10
  86. package/src/NitroGeolocationCompat.nitro.ts +4 -4
  87. package/src/api/getCurrentPosition.ts +5 -1
  88. package/src/api/getLastKnownPosition.ts +5 -1
  89. package/src/api/requestLocationSettings.ts +2 -2
  90. package/src/api/watchHeading.ts +5 -1
  91. package/src/api/watchPosition.ts +5 -1
  92. package/src/compat/getCurrentPosition.ts +2 -2
  93. package/src/compat/watchPosition.ts +2 -2
  94. package/src/publicTypes.ts +7 -16
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
  import com.margelo.nitro.core.NullType
13
14
 
14
15
  /**
@@ -41,6 +42,30 @@ data class GeolocationCoordinates(
41
42
  ) {
42
43
  /* primary constructor */
43
44
 
45
+ override fun equals(other: Any?): Boolean {
46
+ if (this === other) return true
47
+ if (other !is GeolocationCoordinates) return false
48
+ return Objects.deepEquals(this.latitude, other.latitude)
49
+ && Objects.deepEquals(this.longitude, other.longitude)
50
+ && Objects.deepEquals(this.altitude, other.altitude)
51
+ && Objects.deepEquals(this.accuracy, other.accuracy)
52
+ && Objects.deepEquals(this.altitudeAccuracy, other.altitudeAccuracy)
53
+ && Objects.deepEquals(this.heading, other.heading)
54
+ && Objects.deepEquals(this.speed, other.speed)
55
+ }
56
+
57
+ override fun hashCode(): Int {
58
+ return arrayOf(
59
+ latitude,
60
+ longitude,
61
+ altitude,
62
+ accuracy,
63
+ altitudeAccuracy,
64
+ heading,
65
+ speed
66
+ ).contentDeepHashCode()
67
+ }
68
+
44
69
  companion object {
45
70
  /**
46
71
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -32,6 +33,24 @@ data class GeolocationResponse(
32
33
  ) {
33
34
  /* primary constructor */
34
35
 
36
+ override fun equals(other: Any?): Boolean {
37
+ if (this === other) return true
38
+ if (other !is GeolocationResponse) return false
39
+ return Objects.deepEquals(this.coords, other.coords)
40
+ && Objects.deepEquals(this.timestamp, other.timestamp)
41
+ && Objects.deepEquals(this.mocked, other.mocked)
42
+ && Objects.deepEquals(this.provider, other.provider)
43
+ }
44
+
45
+ override fun hashCode(): Int {
46
+ return arrayOf(
47
+ coords,
48
+ timestamp,
49
+ mocked,
50
+ provider
51
+ ).contentDeepHashCode()
52
+ }
53
+
35
54
  companion object {
36
55
  /**
37
56
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -32,6 +33,24 @@ data class Heading(
32
33
  ) {
33
34
  /* primary constructor */
34
35
 
36
+ override fun equals(other: Any?): Boolean {
37
+ if (this === other) return true
38
+ if (other !is Heading) return false
39
+ return Objects.deepEquals(this.magneticHeading, other.magneticHeading)
40
+ && Objects.deepEquals(this.trueHeading, other.trueHeading)
41
+ && Objects.deepEquals(this.accuracy, other.accuracy)
42
+ && Objects.deepEquals(this.timestamp, other.timestamp)
43
+ }
44
+
45
+ override fun hashCode(): Int {
46
+ return arrayOf(
47
+ magneticHeading,
48
+ trueHeading,
49
+ accuracy,
50
+ timestamp
51
+ ).contentDeepHashCode()
52
+ }
53
+
35
54
  companion object {
36
55
  /**
37
56
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -23,6 +24,18 @@ data class HeadingOptions(
23
24
  ) {
24
25
  /* primary constructor */
25
26
 
27
+ override fun equals(other: Any?): Boolean {
28
+ if (this === other) return true
29
+ if (other !is HeadingOptions) return false
30
+ return Objects.deepEquals(this.headingFilter, other.headingFilter)
31
+ }
32
+
33
+ override fun hashCode(): Int {
34
+ return arrayOf(
35
+ headingFilter
36
+ ).contentDeepHashCode()
37
+ }
38
+
26
39
  companion object {
27
40
  /**
28
41
  * Constructor called from C++
@@ -41,21 +41,21 @@ abstract class HybridNitroGeolocationCompatSpec: HybridObject() {
41
41
  return __result
42
42
  }
43
43
 
44
- abstract fun getCurrentPosition(success: (position: CompatGeolocationResponse) -> Unit, error: ((error: CompatGeolocationError) -> Unit)?, options: CompatGeolocationOptions?): Unit
44
+ abstract fun getCurrentPosition(success: (position: CompatGeolocationResponse) -> Unit, options: CompatGeolocationOptions, error: ((error: CompatGeolocationError) -> Unit)?): Unit
45
45
 
46
46
  @DoNotStrip
47
47
  @Keep
48
- private fun getCurrentPosition_cxx(success: Func_void_CompatGeolocationResponse, error: Func_void_CompatGeolocationError?, options: CompatGeolocationOptions?): Unit {
49
- val __result = getCurrentPosition(success, error?.let { it }, options)
48
+ private fun getCurrentPosition_cxx(success: Func_void_CompatGeolocationResponse, options: CompatGeolocationOptions, error: Func_void_CompatGeolocationError?): Unit {
49
+ val __result = getCurrentPosition(success, options, error?.let { it })
50
50
  return __result
51
51
  }
52
52
 
53
- abstract fun watchPosition(success: (position: CompatGeolocationResponse) -> Unit, error: ((error: CompatGeolocationError) -> Unit)?, options: CompatGeolocationOptions?): Double
53
+ abstract fun watchPosition(success: (position: CompatGeolocationResponse) -> Unit, options: CompatGeolocationOptions, error: ((error: CompatGeolocationError) -> Unit)?): Double
54
54
 
55
55
  @DoNotStrip
56
56
  @Keep
57
- private fun watchPosition_cxx(success: Func_void_CompatGeolocationResponse, error: Func_void_CompatGeolocationError?, options: CompatGeolocationOptions?): Double {
58
- val __result = watchPosition(success, error?.let { it }, options)
57
+ private fun watchPosition_cxx(success: Func_void_CompatGeolocationResponse, options: CompatGeolocationOptions, error: Func_void_CompatGeolocationError?): Double {
58
+ val __result = watchPosition(success, options, error?.let { it })
59
59
  return __result
60
60
  }
61
61
 
@@ -58,12 +58,12 @@ abstract class HybridNitroGeolocationSpec: HybridObject() {
58
58
  @Keep
59
59
  abstract fun getLocationAvailability(): Promise<LocationAvailability>
60
60
 
61
- abstract fun requestLocationSettings(success: (status: LocationProviderStatus) -> Unit, error: ((error: LocationError) -> Unit)?, options: LocationSettingsOptions?): Unit
61
+ abstract fun requestLocationSettings(success: (status: LocationProviderStatus) -> Unit, options: LocationSettingsOptions, error: ((error: LocationError) -> Unit)?): Unit
62
62
 
63
63
  @DoNotStrip
64
64
  @Keep
65
- private fun requestLocationSettings_cxx(success: Func_void_LocationProviderStatus, error: Func_void_LocationError?, options: LocationSettingsOptions?): Unit {
66
- val __result = requestLocationSettings(success, error?.let { it }, options)
65
+ private fun requestLocationSettings_cxx(success: Func_void_LocationProviderStatus, options: LocationSettingsOptions, error: Func_void_LocationError?): Unit {
66
+ val __result = requestLocationSettings(success, options, error?.let { it })
67
67
  return __result
68
68
  }
69
69
 
@@ -80,21 +80,21 @@ abstract class HybridNitroGeolocationSpec: HybridObject() {
80
80
  return __result
81
81
  }
82
82
 
83
- abstract fun getCurrentPosition(success: (position: GeolocationResponse) -> Unit, error: ((error: LocationError) -> Unit)?, options: LocationRequestOptions?): Unit
83
+ abstract fun getCurrentPosition(success: (position: GeolocationResponse) -> Unit, options: LocationRequestOptions, error: ((error: LocationError) -> Unit)?): Unit
84
84
 
85
85
  @DoNotStrip
86
86
  @Keep
87
- private fun getCurrentPosition_cxx(success: Func_void_GeolocationResponse, error: Func_void_LocationError?, options: LocationRequestOptions?): Unit {
88
- val __result = getCurrentPosition(success, error?.let { it }, options)
87
+ private fun getCurrentPosition_cxx(success: Func_void_GeolocationResponse, options: LocationRequestOptions, error: Func_void_LocationError?): Unit {
88
+ val __result = getCurrentPosition(success, options, error?.let { it })
89
89
  return __result
90
90
  }
91
91
 
92
- abstract fun getLastKnownPosition(success: (position: GeolocationResponse) -> Unit, error: ((error: LocationError) -> Unit)?, options: LocationRequestOptions?): Unit
92
+ abstract fun getLastKnownPosition(success: (position: GeolocationResponse) -> Unit, options: LocationRequestOptions, error: ((error: LocationError) -> Unit)?): Unit
93
93
 
94
94
  @DoNotStrip
95
95
  @Keep
96
- private fun getLastKnownPosition_cxx(success: Func_void_GeolocationResponse, error: Func_void_LocationError?, options: LocationRequestOptions?): Unit {
97
- val __result = getLastKnownPosition(success, error?.let { it }, options)
96
+ private fun getLastKnownPosition_cxx(success: Func_void_GeolocationResponse, options: LocationRequestOptions, error: Func_void_LocationError?): Unit {
97
+ val __result = getLastKnownPosition(success, options, error?.let { it })
98
98
  return __result
99
99
  }
100
100
 
@@ -125,21 +125,21 @@ abstract class HybridNitroGeolocationSpec: HybridObject() {
125
125
  return __result
126
126
  }
127
127
 
128
- abstract fun watchHeading(success: (heading: Heading) -> Unit, error: ((error: LocationError) -> Unit)?, options: HeadingOptions?): String
128
+ abstract fun watchHeading(success: (heading: Heading) -> Unit, options: HeadingOptions, error: ((error: LocationError) -> Unit)?): String
129
129
 
130
130
  @DoNotStrip
131
131
  @Keep
132
- private fun watchHeading_cxx(success: Func_void_Heading, error: Func_void_LocationError?, options: HeadingOptions?): String {
133
- val __result = watchHeading(success, error?.let { it }, options)
132
+ private fun watchHeading_cxx(success: Func_void_Heading, options: HeadingOptions, error: Func_void_LocationError?): String {
133
+ val __result = watchHeading(success, options, error?.let { it })
134
134
  return __result
135
135
  }
136
136
 
137
- abstract fun watchPosition(success: (position: GeolocationResponse) -> Unit, error: ((error: LocationError) -> Unit)?, options: LocationRequestOptions?): String
137
+ abstract fun watchPosition(success: (position: GeolocationResponse) -> Unit, options: LocationRequestOptions, error: ((error: LocationError) -> Unit)?): String
138
138
 
139
139
  @DoNotStrip
140
140
  @Keep
141
- private fun watchPosition_cxx(success: Func_void_GeolocationResponse, error: Func_void_LocationError?, options: LocationRequestOptions?): String {
142
- val __result = watchPosition(success, error?.let { it }, options)
141
+ private fun watchPosition_cxx(success: Func_void_GeolocationResponse, options: LocationRequestOptions, error: Func_void_LocationError?): String {
142
+ val __result = watchPosition(success, options, error?.let { it })
143
143
  return __result
144
144
  }
145
145
 
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -26,6 +27,20 @@ data class LocationAccuracyOptions(
26
27
  ) {
27
28
  /* primary constructor */
28
29
 
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is LocationAccuracyOptions) return false
33
+ return Objects.deepEquals(this.android, other.android)
34
+ && Objects.deepEquals(this.ios, other.ios)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf(
39
+ android,
40
+ ios
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -26,6 +27,20 @@ data class LocationAvailability(
26
27
  ) {
27
28
  /* primary constructor */
28
29
 
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is LocationAvailability) return false
33
+ return Objects.deepEquals(this.available, other.available)
34
+ && Objects.deepEquals(this.reason, other.reason)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf(
39
+ available,
40
+ reason
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -26,6 +27,20 @@ data class LocationError(
26
27
  ) {
27
28
  /* primary constructor */
28
29
 
30
+ override fun equals(other: Any?): Boolean {
31
+ if (this === other) return true
32
+ if (other !is LocationError) return false
33
+ return Objects.deepEquals(this.code, other.code)
34
+ && Objects.deepEquals(this.message, other.message)
35
+ }
36
+
37
+ override fun hashCode(): Int {
38
+ return arrayOf(
39
+ code,
40
+ message
41
+ ).contentDeepHashCode()
42
+ }
43
+
29
44
  companion object {
30
45
  /**
31
46
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -38,6 +39,28 @@ data class LocationProviderStatus(
38
39
  ) {
39
40
  /* primary constructor */
40
41
 
42
+ override fun equals(other: Any?): Boolean {
43
+ if (this === other) return true
44
+ if (other !is LocationProviderStatus) return false
45
+ return Objects.deepEquals(this.locationServicesEnabled, other.locationServicesEnabled)
46
+ && Objects.deepEquals(this.backgroundModeEnabled, other.backgroundModeEnabled)
47
+ && Objects.deepEquals(this.gpsAvailable, other.gpsAvailable)
48
+ && Objects.deepEquals(this.networkAvailable, other.networkAvailable)
49
+ && Objects.deepEquals(this.passiveAvailable, other.passiveAvailable)
50
+ && Objects.deepEquals(this.googleLocationAccuracyEnabled, other.googleLocationAccuracyEnabled)
51
+ }
52
+
53
+ override fun hashCode(): Int {
54
+ return arrayOf(
55
+ locationServicesEnabled,
56
+ backgroundModeEnabled,
57
+ gpsAvailable,
58
+ networkAvailable,
59
+ passiveAvailable,
60
+ googleLocationAccuracyEnabled
61
+ ).contentDeepHashCode()
62
+ }
63
+
41
64
  companion object {
42
65
  /**
43
66
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -68,6 +69,48 @@ data class LocationRequestOptions(
68
69
  ) {
69
70
  /* primary constructor */
70
71
 
72
+ override fun equals(other: Any?): Boolean {
73
+ if (this === other) return true
74
+ if (other !is LocationRequestOptions) return false
75
+ return Objects.deepEquals(this.timeout, other.timeout)
76
+ && Objects.deepEquals(this.maximumAge, other.maximumAge)
77
+ && Objects.deepEquals(this.enableHighAccuracy, other.enableHighAccuracy)
78
+ && Objects.deepEquals(this.accuracy, other.accuracy)
79
+ && Objects.deepEquals(this.interval, other.interval)
80
+ && Objects.deepEquals(this.fastestInterval, other.fastestInterval)
81
+ && Objects.deepEquals(this.distanceFilter, other.distanceFilter)
82
+ && Objects.deepEquals(this.granularity, other.granularity)
83
+ && Objects.deepEquals(this.waitForAccurateLocation, other.waitForAccurateLocation)
84
+ && Objects.deepEquals(this.maxUpdateAge, other.maxUpdateAge)
85
+ && Objects.deepEquals(this.maxUpdateDelay, other.maxUpdateDelay)
86
+ && Objects.deepEquals(this.maxUpdates, other.maxUpdates)
87
+ && Objects.deepEquals(this.useSignificantChanges, other.useSignificantChanges)
88
+ && Objects.deepEquals(this.activityType, other.activityType)
89
+ && Objects.deepEquals(this.pausesLocationUpdatesAutomatically, other.pausesLocationUpdatesAutomatically)
90
+ && Objects.deepEquals(this.showsBackgroundLocationIndicator, other.showsBackgroundLocationIndicator)
91
+ }
92
+
93
+ override fun hashCode(): Int {
94
+ return arrayOf(
95
+ timeout,
96
+ maximumAge,
97
+ enableHighAccuracy,
98
+ accuracy,
99
+ interval,
100
+ fastestInterval,
101
+ distanceFilter,
102
+ granularity,
103
+ waitForAccurateLocation,
104
+ maxUpdateAge,
105
+ maxUpdateDelay,
106
+ maxUpdates,
107
+ useSignificantChanges,
108
+ activityType,
109
+ pausesLocationUpdatesAutomatically,
110
+ showsBackgroundLocationIndicator
111
+ ).contentDeepHashCode()
112
+ }
113
+
71
114
  companion object {
72
115
  /**
73
116
  * Constructor called from C++
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -41,6 +42,30 @@ data class LocationSettingsOptions(
41
42
  ) {
42
43
  /* primary constructor */
43
44
 
45
+ override fun equals(other: Any?): Boolean {
46
+ if (this === other) return true
47
+ if (other !is LocationSettingsOptions) return false
48
+ return Objects.deepEquals(this.enableHighAccuracy, other.enableHighAccuracy)
49
+ && Objects.deepEquals(this.accuracy, other.accuracy)
50
+ && Objects.deepEquals(this.interval, other.interval)
51
+ && Objects.deepEquals(this.fastestInterval, other.fastestInterval)
52
+ && Objects.deepEquals(this.distanceFilter, other.distanceFilter)
53
+ && Objects.deepEquals(this.alwaysShow, other.alwaysShow)
54
+ && Objects.deepEquals(this.needBle, other.needBle)
55
+ }
56
+
57
+ override fun hashCode(): Int {
58
+ return arrayOf(
59
+ enableHighAccuracy,
60
+ accuracy,
61
+ interval,
62
+ fastestInterval,
63
+ distanceFilter,
64
+ alwaysShow,
65
+ needBle
66
+ ).contentDeepHashCode()
67
+ }
68
+
44
69
  companion object {
45
70
  /**
46
71
  * Constructor called from C++
@@ -21,6 +21,22 @@ sealed class NullableDouble {
21
21
  @DoNotStrip
22
22
  data class Second(@DoNotStrip val value: Double): NullableDouble()
23
23
 
24
+ inline fun <reified T> asType(): T? {
25
+ return when (this) {
26
+ is First -> (value) as? T
27
+ is Second -> (value) as? T
28
+ }
29
+ }
30
+ inline fun <reified T> isType(): Boolean {
31
+ return asType<T>() != null
32
+ }
33
+ inline fun <R> match(first: (NullType) -> R, second: (Double) -> R): R {
34
+ return when (this) {
35
+ is First -> first(value)
36
+ is Second -> second(value)
37
+ }
38
+ }
39
+
24
40
  val isFirst: Boolean
25
41
  get() = this is First
26
42
  val isSecond: Boolean
@@ -35,13 +51,6 @@ sealed class NullableDouble {
35
51
  return value
36
52
  }
37
53
 
38
- inline fun <R> match(first: (NullType) -> R, second: (Double) -> R): R {
39
- return when (this) {
40
- is First -> first(value)
41
- is Second -> second(value)
42
- }
43
- }
44
-
45
54
  companion object {
46
55
  @JvmStatic
47
56
  @DoNotStrip
@@ -9,6 +9,7 @@ package com.margelo.nitro.nitrogeolocation
9
9
 
10
10
  import androidx.annotation.Keep
11
11
  import com.facebook.proguard.annotations.DoNotStrip
12
+ import java.util.Objects
12
13
 
13
14
 
14
15
  /**
@@ -41,6 +42,30 @@ data class ReverseGeocodedAddress(
41
42
  ) {
42
43
  /* primary constructor */
43
44
 
45
+ override fun equals(other: Any?): Boolean {
46
+ if (this === other) return true
47
+ if (other !is ReverseGeocodedAddress) return false
48
+ return Objects.deepEquals(this.country, other.country)
49
+ && Objects.deepEquals(this.region, other.region)
50
+ && Objects.deepEquals(this.city, other.city)
51
+ && Objects.deepEquals(this.district, other.district)
52
+ && Objects.deepEquals(this.street, other.street)
53
+ && Objects.deepEquals(this.postalCode, other.postalCode)
54
+ && Objects.deepEquals(this.formattedAddress, other.formattedAddress)
55
+ }
56
+
57
+ override fun hashCode(): Int {
58
+ return arrayOf(
59
+ country,
60
+ region,
61
+ city,
62
+ district,
63
+ street,
64
+ postalCode,
65
+ formattedAddress
66
+ ).contentDeepHashCode()
67
+ }
68
+
44
69
  companion object {
45
70
  /**
46
71
  * Constructor called from C++
@@ -39,17 +39,17 @@ int initialize(JavaVM* vm) {
39
39
  }
40
40
 
41
41
  struct JHybridNitroGeolocationSpecImpl: public jni::JavaClass<JHybridNitroGeolocationSpecImpl, JHybridNitroGeolocationSpec::JavaPart> {
42
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/NitroGeolocation;";
42
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/NitroGeolocation;";
43
43
  static std::shared_ptr<JHybridNitroGeolocationSpec> create() {
44
- static auto constructorFn = javaClassStatic()->getConstructor<JHybridNitroGeolocationSpecImpl::javaobject()>();
44
+ static const auto constructorFn = javaClassStatic()->getConstructor<JHybridNitroGeolocationSpecImpl::javaobject()>();
45
45
  jni::local_ref<JHybridNitroGeolocationSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
46
46
  return javaPart->getJHybridNitroGeolocationSpec();
47
47
  }
48
48
  };
49
49
  struct JHybridNitroGeolocationCompatSpecImpl: public jni::JavaClass<JHybridNitroGeolocationCompatSpecImpl, JHybridNitroGeolocationCompatSpec::JavaPart> {
50
- static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/NitroGeolocationCompat;";
50
+ static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/NitroGeolocationCompat;";
51
51
  static std::shared_ptr<JHybridNitroGeolocationCompatSpec> create() {
52
- static auto constructorFn = javaClassStatic()->getConstructor<JHybridNitroGeolocationCompatSpecImpl::javaobject()>();
52
+ static const auto constructorFn = javaClassStatic()->getConstructor<JHybridNitroGeolocationCompatSpecImpl::javaobject()>();
53
53
  jni::local_ref<JHybridNitroGeolocationCompatSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
54
54
  return javaPart->getJHybridNitroGeolocationCompatSpec();
55
55
  }
@@ -56,5 +56,7 @@ def add_nitrogen_files(spec)
56
56
  "SWIFT_OBJC_INTEROP_MODE" => "objcxx",
57
57
  # Enables stricter modular headers
58
58
  "DEFINES_MODULE" => "YES",
59
+ # Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
60
+ "SWIFT_INSTALL_OBJC_HEADER" => "NO",
59
61
  })
60
62
  end