react-native-nitro-geolocation 1.2.3 → 1.2.5

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 (93) hide show
  1. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocation.kt +10 -10
  2. package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocationCompat.kt +4 -4
  3. package/ios/NitroGeolocation.swift +17 -11
  4. package/ios/NitroGeolocationCompat.swift +6 -4
  5. package/nitrogen/generated/android/c++/JAccuracyAuthorization.hpp +1 -1
  6. package/nitrogen/generated/android/c++/JAndroidAccuracyPreset.hpp +1 -1
  7. package/nitrogen/generated/android/c++/JAndroidGranularity.hpp +1 -1
  8. package/nitrogen/generated/android/c++/JAuthorizationLevel.hpp +1 -1
  9. package/nitrogen/generated/android/c++/JAuthorizationLevelInternal.hpp +1 -1
  10. package/nitrogen/generated/android/c++/JCompatGeolocationConfigurationInternal.hpp +1 -1
  11. package/nitrogen/generated/android/c++/JCompatGeolocationError.hpp +1 -1
  12. package/nitrogen/generated/android/c++/JCompatGeolocationOptions.hpp +1 -1
  13. package/nitrogen/generated/android/c++/JCompatGeolocationResponse.hpp +1 -1
  14. package/nitrogen/generated/android/c++/JFunc_void.hpp +2 -2
  15. package/nitrogen/generated/android/c++/JFunc_void_AccuracyAuthorization.hpp +2 -2
  16. package/nitrogen/generated/android/c++/JFunc_void_CompatGeolocationError.hpp +2 -2
  17. package/nitrogen/generated/android/c++/JFunc_void_CompatGeolocationResponse.hpp +2 -2
  18. package/nitrogen/generated/android/c++/JFunc_void_GeolocationResponse.hpp +2 -2
  19. package/nitrogen/generated/android/c++/JFunc_void_Heading.hpp +2 -2
  20. package/nitrogen/generated/android/c++/JFunc_void_LocationError.hpp +2 -2
  21. package/nitrogen/generated/android/c++/JFunc_void_LocationProviderStatus.hpp +2 -2
  22. package/nitrogen/generated/android/c++/JFunc_void_PermissionStatus.hpp +2 -2
  23. package/nitrogen/generated/android/c++/JFunc_void_std__vector_GeocodedLocation_.hpp +16 -16
  24. package/nitrogen/generated/android/c++/JFunc_void_std__vector_ReverseGeocodedAddress_.hpp +16 -16
  25. package/nitrogen/generated/android/c++/JGeocodedLocation.hpp +1 -1
  26. package/nitrogen/generated/android/c++/JGeocodingCoordinates.hpp +1 -1
  27. package/nitrogen/generated/android/c++/JGeolocationConfiguration.hpp +1 -1
  28. package/nitrogen/generated/android/c++/JGeolocationCoordinates.hpp +1 -1
  29. package/nitrogen/generated/android/c++/JGeolocationResponse.hpp +1 -1
  30. package/nitrogen/generated/android/c++/JHeading.hpp +1 -1
  31. package/nitrogen/generated/android/c++/JHeadingOptions.hpp +1 -1
  32. package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.cpp +6 -6
  33. package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.hpp +4 -4
  34. package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.cpp +15 -15
  35. package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.hpp +7 -7
  36. package/nitrogen/generated/android/c++/JIOSAccuracyPreset.hpp +1 -1
  37. package/nitrogen/generated/android/c++/JIOSActivityType.hpp +1 -1
  38. package/nitrogen/generated/android/c++/JLocationAccuracyOptions.hpp +1 -1
  39. package/nitrogen/generated/android/c++/JLocationAvailability.hpp +1 -1
  40. package/nitrogen/generated/android/c++/JLocationError.hpp +1 -1
  41. package/nitrogen/generated/android/c++/JLocationProvider.hpp +1 -1
  42. package/nitrogen/generated/android/c++/JLocationProviderInternal.hpp +1 -1
  43. package/nitrogen/generated/android/c++/JLocationProviderStatus.hpp +1 -1
  44. package/nitrogen/generated/android/c++/JLocationProviderUsed.hpp +1 -1
  45. package/nitrogen/generated/android/c++/JLocationRequestOptions.hpp +1 -1
  46. package/nitrogen/generated/android/c++/JLocationSettingsOptions.hpp +1 -1
  47. package/nitrogen/generated/android/c++/JNullableDouble.hpp +3 -3
  48. package/nitrogen/generated/android/c++/JPermissionStatus.hpp +1 -1
  49. package/nitrogen/generated/android/c++/JReverseGeocodedAddress.hpp +1 -1
  50. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationConfigurationInternal.kt +19 -0
  51. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationError.kt +21 -0
  52. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationOptions.kt +33 -0
  53. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationResponse.kt +15 -0
  54. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeocodedLocation.kt +17 -0
  55. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeocodingCoordinates.kt +15 -0
  56. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationConfiguration.kt +19 -0
  57. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationCoordinates.kt +25 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationResponse.kt +19 -0
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Heading.kt +19 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HeadingOptions.kt +13 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationCompatSpec.kt +6 -6
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationSpec.kt +15 -15
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationAccuracyOptions.kt +15 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationAvailability.kt +15 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationError.kt +15 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationProviderStatus.kt +23 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationRequestOptions.kt +43 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationSettingsOptions.kt +25 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/NullableDouble.kt +16 -7
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/ReverseGeocodedAddress.kt +25 -0
  71. package/nitrogen/generated/android/nitrogeolocationOnLoad.cpp +4 -4
  72. package/nitrogen/generated/ios/NitroGeolocation+autolinking.rb +2 -0
  73. package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.hpp +0 -72
  74. package/nitrogen/generated/ios/c++/HybridNitroGeolocationCompatSpecSwift.hpp +4 -4
  75. package/nitrogen/generated/ios/c++/HybridNitroGeolocationSpecSwift.hpp +10 -10
  76. package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec.swift +2 -2
  77. package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec_cxx.swift +6 -6
  78. package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec.swift +5 -5
  79. package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec_cxx.swift +15 -15
  80. package/nitrogen/generated/ios/swift/NullableDouble.swift +12 -0
  81. package/nitrogen/generated/shared/c++/HybridNitroGeolocationCompatSpec.hpp +2 -2
  82. package/nitrogen/generated/shared/c++/HybridNitroGeolocationSpec.hpp +5 -5
  83. package/package.json +2 -1
  84. package/src/NitroGeolocation.nitro.ts +10 -10
  85. package/src/NitroGeolocationCompat.nitro.ts +4 -4
  86. package/src/api/getCurrentPosition.ts +5 -1
  87. package/src/api/getLastKnownPosition.ts +5 -1
  88. package/src/api/requestLocationSettings.ts +2 -2
  89. package/src/api/watchHeading.ts +5 -1
  90. package/src/api/watchPosition.ts +5 -1
  91. package/src/compat/getCurrentPosition.ts +2 -2
  92. package/src/compat/watchPosition.ts +2 -2
  93. 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
 
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
@@ -20,8 +20,6 @@ namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevelIntern
20
20
  namespace margelo::nitro::nitrogeolocation { enum class AuthorizationLevel; }
21
21
  // Forward declaration of `CompatGeolocationError` to properly resolve imports.
22
22
  namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationError; }
23
- // Forward declaration of `CompatGeolocationOptions` to properly resolve imports.
24
- namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationOptions; }
25
23
  // Forward declaration of `CompatGeolocationResponse` to properly resolve imports.
26
24
  namespace margelo::nitro::nitrogeolocation { struct CompatGeolocationResponse; }
27
25
  // Forward declaration of `GeocodedLocation` to properly resolve imports.
@@ -30,8 +28,6 @@ namespace margelo::nitro::nitrogeolocation { struct GeocodedLocation; }
30
28
  namespace margelo::nitro::nitrogeolocation { struct GeolocationCoordinates; }
31
29
  // Forward declaration of `GeolocationResponse` to properly resolve imports.
32
30
  namespace margelo::nitro::nitrogeolocation { struct GeolocationResponse; }
33
- // Forward declaration of `HeadingOptions` to properly resolve imports.
34
- namespace margelo::nitro::nitrogeolocation { struct HeadingOptions; }
35
31
  // Forward declaration of `Heading` to properly resolve imports.
36
32
  namespace margelo::nitro::nitrogeolocation { struct Heading; }
37
33
  // Forward declaration of `HybridNitroGeolocationCompatSpec` to properly resolve imports.
@@ -56,10 +52,6 @@ namespace margelo::nitro::nitrogeolocation { struct LocationProviderStatus; }
56
52
  namespace margelo::nitro::nitrogeolocation { enum class LocationProviderUsed; }
57
53
  // Forward declaration of `LocationProvider` to properly resolve imports.
58
54
  namespace margelo::nitro::nitrogeolocation { enum class LocationProvider; }
59
- // Forward declaration of `LocationRequestOptions` to properly resolve imports.
60
- namespace margelo::nitro::nitrogeolocation { struct LocationRequestOptions; }
61
- // Forward declaration of `LocationSettingsOptions` to properly resolve imports.
62
- namespace margelo::nitro::nitrogeolocation { struct LocationSettingsOptions; }
63
55
  // Forward declaration of `PermissionStatus` to properly resolve imports.
64
56
  namespace margelo::nitro::nitrogeolocation { enum class PermissionStatus; }
65
57
  // Forward declaration of `ReverseGeocodedAddress` to properly resolve imports.
@@ -78,13 +70,11 @@ namespace NitroGeolocation { class HybridNitroGeolocationSpec_cxx; }
78
70
  #include "AuthorizationLevel.hpp"
79
71
  #include "AuthorizationLevelInternal.hpp"
80
72
  #include "CompatGeolocationError.hpp"
81
- #include "CompatGeolocationOptions.hpp"
82
73
  #include "CompatGeolocationResponse.hpp"
83
74
  #include "GeocodedLocation.hpp"
84
75
  #include "GeolocationCoordinates.hpp"
85
76
  #include "GeolocationResponse.hpp"
86
77
  #include "Heading.hpp"
87
- #include "HeadingOptions.hpp"
88
78
  #include "HybridNitroGeolocationCompatSpec.hpp"
89
79
  #include "HybridNitroGeolocationSpec.hpp"
90
80
  #include "IOSAccuracyPreset.hpp"
@@ -96,8 +86,6 @@ namespace NitroGeolocation { class HybridNitroGeolocationSpec_cxx; }
96
86
  #include "LocationProviderInternal.hpp"
97
87
  #include "LocationProviderStatus.hpp"
98
88
  #include "LocationProviderUsed.hpp"
99
- #include "LocationRequestOptions.hpp"
100
- #include "LocationSettingsOptions.hpp"
101
89
  #include "PermissionStatus.hpp"
102
90
  #include "ReverseGeocodedAddress.hpp"
103
91
  #include <NitroModules/Null.hpp>
@@ -433,21 +421,6 @@ namespace margelo::nitro::nitrogeolocation::bridge::swift {
433
421
  return optional.value();
434
422
  }
435
423
 
436
- // pragma MARK: std::optional<LocationSettingsOptions>
437
- /**
438
- * Specialized version of `std::optional<LocationSettingsOptions>`.
439
- */
440
- using std__optional_LocationSettingsOptions_ = std::optional<LocationSettingsOptions>;
441
- inline std::optional<LocationSettingsOptions> create_std__optional_LocationSettingsOptions_(const LocationSettingsOptions& value) noexcept {
442
- return std::optional<LocationSettingsOptions>(value);
443
- }
444
- inline bool has_value_std__optional_LocationSettingsOptions_(const std::optional<LocationSettingsOptions>& optional) noexcept {
445
- return optional.has_value();
446
- }
447
- inline LocationSettingsOptions get_std__optional_LocationSettingsOptions_(const std::optional<LocationSettingsOptions>& optional) noexcept {
448
- return optional.value();
449
- }
450
-
451
424
  // pragma MARK: std::shared_ptr<Promise<AccuracyAuthorization>>
452
425
  /**
453
426
  * Specialized version of `std::shared_ptr<Promise<AccuracyAuthorization>>`.
@@ -593,21 +566,6 @@ namespace margelo::nitro::nitrogeolocation::bridge::swift {
593
566
  return optional.value();
594
567
  }
595
568
 
596
- // pragma MARK: std::optional<LocationRequestOptions>
597
- /**
598
- * Specialized version of `std::optional<LocationRequestOptions>`.
599
- */
600
- using std__optional_LocationRequestOptions_ = std::optional<LocationRequestOptions>;
601
- inline std::optional<LocationRequestOptions> create_std__optional_LocationRequestOptions_(const LocationRequestOptions& value) noexcept {
602
- return std::optional<LocationRequestOptions>(value);
603
- }
604
- inline bool has_value_std__optional_LocationRequestOptions_(const std::optional<LocationRequestOptions>& optional) noexcept {
605
- return optional.has_value();
606
- }
607
- inline LocationRequestOptions get_std__optional_LocationRequestOptions_(const std::optional<LocationRequestOptions>& optional) noexcept {
608
- return optional.value();
609
- }
610
-
611
569
  // pragma MARK: std::vector<GeocodedLocation>
612
570
  /**
613
571
  * Specialized version of `std::vector<GeocodedLocation>`.
@@ -696,21 +654,6 @@ namespace margelo::nitro::nitrogeolocation::bridge::swift {
696
654
  return Func_void_Heading_Wrapper(std::move(value));
697
655
  }
698
656
 
699
- // pragma MARK: std::optional<HeadingOptions>
700
- /**
701
- * Specialized version of `std::optional<HeadingOptions>`.
702
- */
703
- using std__optional_HeadingOptions_ = std::optional<HeadingOptions>;
704
- inline std::optional<HeadingOptions> create_std__optional_HeadingOptions_(const HeadingOptions& value) noexcept {
705
- return std::optional<HeadingOptions>(value);
706
- }
707
- inline bool has_value_std__optional_HeadingOptions_(const std::optional<HeadingOptions>& optional) noexcept {
708
- return optional.has_value();
709
- }
710
- inline HeadingOptions get_std__optional_HeadingOptions_(const std::optional<HeadingOptions>& optional) noexcept {
711
- return optional.value();
712
- }
713
-
714
657
  // pragma MARK: std::shared_ptr<HybridNitroGeolocationSpec>
715
658
  /**
716
659
  * Specialized version of `std::shared_ptr<HybridNitroGeolocationSpec>`.
@@ -912,21 +855,6 @@ namespace margelo::nitro::nitrogeolocation::bridge::swift {
912
855
  return Func_void_CompatGeolocationResponse_Wrapper(std::move(value));
913
856
  }
914
857
 
915
- // pragma MARK: std::optional<CompatGeolocationOptions>
916
- /**
917
- * Specialized version of `std::optional<CompatGeolocationOptions>`.
918
- */
919
- using std__optional_CompatGeolocationOptions_ = std::optional<CompatGeolocationOptions>;
920
- inline std::optional<CompatGeolocationOptions> create_std__optional_CompatGeolocationOptions_(const CompatGeolocationOptions& value) noexcept {
921
- return std::optional<CompatGeolocationOptions>(value);
922
- }
923
- inline bool has_value_std__optional_CompatGeolocationOptions_(const std::optional<CompatGeolocationOptions>& optional) noexcept {
924
- return optional.has_value();
925
- }
926
- inline CompatGeolocationOptions get_std__optional_CompatGeolocationOptions_(const std::optional<CompatGeolocationOptions>& optional) noexcept {
927
- return optional.value();
928
- }
929
-
930
858
  // pragma MARK: std::shared_ptr<HybridNitroGeolocationCompatSpec>
931
859
  /**
932
860
  * Specialized version of `std::shared_ptr<HybridNitroGeolocationCompatSpec>`.
@@ -114,14 +114,14 @@ namespace margelo::nitro::nitrogeolocation {
114
114
  std::rethrow_exception(__result.error());
115
115
  }
116
116
  }
117
- inline void getCurrentPosition(const std::function<void(const CompatGeolocationResponse& /* position */)>& success, const std::optional<std::function<void(const CompatGeolocationError& /* error */)>>& error, const std::optional<CompatGeolocationOptions>& options) override {
118
- auto __result = _swiftPart.getCurrentPosition(success, error, options);
117
+ inline void getCurrentPosition(const std::function<void(const CompatGeolocationResponse& /* position */)>& success, const CompatGeolocationOptions& options, const std::optional<std::function<void(const CompatGeolocationError& /* error */)>>& error) override {
118
+ auto __result = _swiftPart.getCurrentPosition(success, std::forward<decltype(options)>(options), error);
119
119
  if (__result.hasError()) [[unlikely]] {
120
120
  std::rethrow_exception(__result.error());
121
121
  }
122
122
  }
123
- inline double watchPosition(const std::function<void(const CompatGeolocationResponse& /* position */)>& success, const std::optional<std::function<void(const CompatGeolocationError& /* error */)>>& error, const std::optional<CompatGeolocationOptions>& options) override {
124
- auto __result = _swiftPart.watchPosition(success, error, options);
123
+ inline double watchPosition(const std::function<void(const CompatGeolocationResponse& /* position */)>& success, const CompatGeolocationOptions& options, const std::optional<std::function<void(const CompatGeolocationError& /* error */)>>& error) override {
124
+ auto __result = _swiftPart.watchPosition(success, std::forward<decltype(options)>(options), error);
125
125
  if (__result.hasError()) [[unlikely]] {
126
126
  std::rethrow_exception(__result.error());
127
127
  }