react-native-nitro-geolocation 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +316 -0
- package/android/build.gradle +6 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidAccuracy.kt +105 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidHeadingManager.kt +313 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidLocationSettings.kt +313 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/GetCurrentPosition.kt +46 -45
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/LocationMetadata.kt +26 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/LocationValues.kt +31 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocation.kt +1025 -140
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocationCompat.kt +11 -11
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/RequestAuthorization.kt +6 -6
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/WatchPosition.kt +46 -45
- package/ios/CLLocation+GeolocationMetadata.swift +32 -0
- package/ios/LocationManager.swift +205 -51
- package/ios/NitroGeolocation.swift +949 -110
- package/ios/NitroGeolocationCompat.swift +7 -7
- package/nitrogen/generated/android/c++/JAccuracyAuthorization.hpp +61 -0
- package/nitrogen/generated/android/c++/JAndroidAccuracyPreset.hpp +64 -0
- package/nitrogen/generated/android/c++/JAndroidGranularity.hpp +61 -0
- package/nitrogen/generated/android/c++/{JRNConfigurationInternal.hpp → JCompatGeolocationConfigurationInternal.hpp} +10 -10
- package/nitrogen/generated/android/c++/{JGeolocationError.hpp → JCompatGeolocationError.hpp} +10 -10
- package/nitrogen/generated/android/c++/JCompatGeolocationOptions.hpp +105 -0
- package/nitrogen/generated/android/c++/JCompatGeolocationResponse.hpp +67 -0
- package/nitrogen/generated/android/c++/JFunc_void_AccuracyAuthorization.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_CompatGeolocationError.hpp +78 -0
- package/nitrogen/generated/android/c++/JFunc_void_CompatGeolocationResponse.hpp +84 -0
- package/nitrogen/generated/android/c++/JFunc_void_GeolocationResponse.hpp +2 -0
- package/nitrogen/generated/android/c++/JFunc_void_Heading.hpp +78 -0
- package/nitrogen/generated/android/c++/JFunc_void_LocationProviderStatus.hpp +78 -0
- package/nitrogen/generated/android/c++/JFunc_void_PermissionStatus.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_GeocodedLocation_.hpp +97 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_ReverseGeocodedAddress_.hpp +98 -0
- package/nitrogen/generated/android/c++/JGeocodedLocation.hpp +65 -0
- package/nitrogen/generated/android/c++/JGeocodingCoordinates.hpp +61 -0
- package/nitrogen/generated/android/c++/{JModernGeolocationConfiguration.hpp → JGeolocationConfiguration.hpp} +10 -10
- package/nitrogen/generated/android/c++/JGeolocationResponse.hpp +13 -3
- package/nitrogen/generated/android/c++/JHeading.hpp +69 -0
- package/nitrogen/generated/android/c++/JHeadingOptions.hpp +57 -0
- package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.cpp +46 -30
- package/nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.hpp +4 -4
- package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.cpp +169 -33
- package/nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.hpp +14 -3
- package/nitrogen/generated/android/c++/JIOSAccuracyPreset.hpp +73 -0
- package/nitrogen/generated/android/c++/JIOSActivityType.hpp +67 -0
- package/nitrogen/generated/android/c++/JLocationAccuracyOptions.hpp +65 -0
- package/nitrogen/generated/android/c++/JLocationAvailability.hpp +62 -0
- package/nitrogen/generated/android/c++/JLocationProviderStatus.hpp +77 -0
- package/nitrogen/generated/android/c++/JLocationProviderUsed.hpp +67 -0
- package/nitrogen/generated/android/c++/JLocationRequestOptions.hpp +49 -3
- package/nitrogen/generated/android/c++/{JGeolocationOptions.hpp → JLocationSettingsOptions.hpp} +28 -22
- package/nitrogen/generated/android/c++/JReverseGeocodedAddress.hpp +82 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AccuracyAuthorization.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AndroidAccuracyPreset.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AndroidGranularity.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{RNConfigurationInternal.kt → CompatGeolocationConfigurationInternal.kt} +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{GeolocationError.kt → CompatGeolocationError.kt} +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationOptions.kt +68 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/CompatGeolocationResponse.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_AccuracyAuthorization.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{Func_void_GeolocationError.kt → Func_void_CompatGeolocationError.kt} +9 -9
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_CompatGeolocationResponse.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_Heading.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_LocationProviderStatus.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_PermissionStatus.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_std__vector_GeocodedLocation_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_std__vector_ReverseGeocodedAddress_.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeocodedLocation.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeocodingCoordinates.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{ModernGeolocationConfiguration.kt → GeolocationConfiguration.kt} +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeolocationResponse.kt +9 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Heading.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HeadingOptions.kt +38 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationCompatSpec.kt +7 -7
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroGeolocationSpec.kt +92 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/IOSAccuracyPreset.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/IOSActivityType.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationAccuracyOptions.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationAvailability.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationProviderStatus.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationProviderUsed.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationRequestOptions.kt +30 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/{GeolocationOptions.kt → LocationSettingsOptions.kt} +11 -11
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/ReverseGeocodedAddress.kt +56 -0
- package/nitrogen/generated/android/nitrogeolocationOnLoad.cpp +18 -4
- package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.cpp +76 -12
- package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.hpp +519 -77
- package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Umbrella.hpp +61 -12
- package/nitrogen/generated/ios/c++/HybridNitroGeolocationCompatSpecSwift.hpp +28 -16
- package/nitrogen/generated/ios/c++/HybridNitroGeolocationSpecSwift.hpp +131 -13
- package/nitrogen/generated/ios/swift/AccuracyAuthorization.swift +44 -0
- package/nitrogen/generated/ios/swift/AndroidAccuracyPreset.swift +48 -0
- package/nitrogen/generated/ios/swift/AndroidGranularity.swift +44 -0
- package/nitrogen/generated/ios/swift/{RNConfigurationInternal.swift → CompatGeolocationConfigurationInternal.swift} +5 -5
- package/nitrogen/generated/ios/swift/{GeolocationError.swift → CompatGeolocationError.swift} +5 -5
- package/nitrogen/generated/ios/swift/CompatGeolocationOptions.swift +208 -0
- package/nitrogen/generated/ios/swift/CompatGeolocationResponse.swift +34 -0
- package/nitrogen/generated/ios/swift/Func_void_AccuracyAuthorization.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_CompatGeolocationError.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_CompatGeolocationResponse.swift +46 -0
- package/nitrogen/generated/ios/swift/{Func_void_GeolocationError.swift → Func_void_Heading.swift} +11 -11
- package/nitrogen/generated/ios/swift/Func_void_LocationAvailability.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_LocationProviderStatus.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_GeocodedLocation_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_ReverseGeocodedAddress_.swift +46 -0
- package/nitrogen/generated/ios/swift/GeocodedLocation.swift +52 -0
- package/nitrogen/generated/ios/swift/GeocodingCoordinates.swift +34 -0
- package/nitrogen/generated/ios/swift/{ModernGeolocationConfiguration.swift → GeolocationConfiguration.swift} +5 -5
- package/nitrogen/generated/ios/swift/GeolocationResponse.swift +31 -2
- package/nitrogen/generated/ios/swift/Heading.swift +70 -0
- package/nitrogen/generated/ios/swift/HeadingOptions.swift +42 -0
- package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec.swift +4 -4
- package/nitrogen/generated/ios/swift/HybridNitroGeolocationCompatSpec_cxx.swift +28 -28
- package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec.swift +14 -3
- package/nitrogen/generated/ios/swift/HybridNitroGeolocationSpec_cxx.swift +318 -15
- package/nitrogen/generated/ios/swift/IOSAccuracyPreset.swift +60 -0
- package/nitrogen/generated/ios/swift/IOSActivityType.swift +52 -0
- package/nitrogen/generated/ios/swift/LocationAccuracyOptions.swift +46 -0
- package/nitrogen/generated/ios/swift/LocationAvailability.swift +47 -0
- package/nitrogen/generated/ios/swift/LocationProviderStatus.swift +106 -0
- package/nitrogen/generated/ios/swift/LocationProviderUsed.swift +52 -0
- package/nitrogen/generated/ios/swift/LocationRequestOptions.swift +142 -1
- package/nitrogen/generated/ios/swift/{GeolocationOptions.swift → LocationSettingsOptions.swift} +39 -46
- package/nitrogen/generated/ios/swift/ReverseGeocodedAddress.swift +150 -0
- package/nitrogen/generated/shared/c++/AccuracyAuthorization.hpp +80 -0
- package/nitrogen/generated/shared/c++/AndroidAccuracyPreset.hpp +84 -0
- package/nitrogen/generated/shared/c++/AndroidGranularity.hpp +80 -0
- package/nitrogen/generated/shared/c++/{RNConfigurationInternal.hpp → CompatGeolocationConfigurationInternal.hpp} +11 -11
- package/nitrogen/generated/shared/c++/{GeolocationError.hpp → CompatGeolocationError.hpp} +11 -11
- package/nitrogen/generated/shared/c++/CompatGeolocationOptions.hpp +128 -0
- package/nitrogen/generated/shared/c++/CompatGeolocationResponse.hpp +88 -0
- package/nitrogen/generated/shared/c++/GeocodedLocation.hpp +91 -0
- package/nitrogen/generated/shared/c++/GeocodingCoordinates.hpp +87 -0
- package/nitrogen/generated/shared/c++/{ModernGeolocationConfiguration.hpp → GeolocationConfiguration.hpp} +11 -11
- package/nitrogen/generated/shared/c++/GeolocationResponse.hpp +14 -2
- package/nitrogen/generated/shared/c++/Heading.hpp +95 -0
- package/nitrogen/generated/shared/c++/HeadingOptions.hpp +83 -0
- package/nitrogen/generated/shared/c++/HybridNitroGeolocationCompatSpec.hpp +16 -16
- package/nitrogen/generated/shared/c++/HybridNitroGeolocationSpec.cpp +11 -0
- package/nitrogen/generated/shared/c++/HybridNitroGeolocationSpec.hpp +51 -12
- package/nitrogen/generated/shared/c++/IOSAccuracyPreset.hpp +96 -0
- package/nitrogen/generated/shared/c++/IOSActivityType.hpp +88 -0
- package/nitrogen/generated/shared/c++/LocationAccuracyOptions.hpp +92 -0
- package/nitrogen/generated/shared/c++/LocationAvailability.hpp +88 -0
- package/nitrogen/generated/shared/c++/LocationProviderStatus.hpp +103 -0
- package/nitrogen/generated/shared/c++/LocationProviderUsed.hpp +88 -0
- package/nitrogen/generated/shared/c++/LocationRequestOptions.hpp +47 -3
- package/nitrogen/generated/shared/c++/{GeolocationOptions.hpp → LocationSettingsOptions.hpp} +26 -24
- package/nitrogen/generated/shared/c++/ReverseGeocodedAddress.hpp +108 -0
- package/package.json +1 -1
- package/src/NitroGeolocation.nitro.ts +291 -17
- package/src/NitroGeolocationCompat.nitro.ts +12 -12
- package/src/api/geocode.ts +18 -0
- package/src/api/getAccuracyAuthorization.ts +12 -0
- package/src/api/getCurrentPosition.ts +5 -3
- package/src/api/getHeading.ts +13 -0
- package/src/api/getLastKnownPosition.ts +28 -0
- package/src/api/getLocationAvailability.ts +11 -0
- package/src/api/getProviderStatus.ts +16 -0
- package/src/api/hasServicesEnabled.ts +13 -0
- package/src/api/index.ts +11 -0
- package/src/api/requestLocationSettings.ts +29 -0
- package/src/api/requestPermission.ts +3 -1
- package/src/api/requestTemporaryFullAccuracy.ts +21 -0
- package/src/api/reverseGeocode.ts +23 -0
- package/src/api/setConfiguration.ts +8 -4
- package/src/api/watchHeading.ts +19 -0
- package/src/api/watchPosition.ts +2 -2
- package/src/compat/getCurrentPosition.ts +7 -7
- package/src/compat/index.tsx +5 -5
- package/src/compat/requestAuthorization.ts +2 -2
- package/src/compat/setRNConfiguration.ts +7 -5
- package/src/compat/watchPosition.ts +7 -7
- package/src/devtools/getCurrentPosition.ts +5 -3
- package/src/devtools/index.ts +1 -1
- package/src/devtools/watchPosition.ts +6 -7
- package/src/hooks/useWatchPosition.ts +2 -2
- package/src/index.tsx +35 -6
- package/src/publicTypes.ts +96 -0
- package/src/types.ts +113 -37
- package/src/utils/errors.test.ts +65 -0
- package/src/utils/errors.ts +45 -18
- package/src/utils/index.ts +2 -2
- package/src/utils/provider.test.ts +172 -1
- package/src/utils/provider.ts +50 -5
- package/nitrogen/generated/android/c++/JFunc_void_GeolocationError.hpp +0 -78
|
@@ -125,7 +125,7 @@ open class HybridNitroGeolocationSpec_cxx {
|
|
|
125
125
|
|
|
126
126
|
// Methods
|
|
127
127
|
@inline(__always)
|
|
128
|
-
public final func setConfiguration(config:
|
|
128
|
+
public final func setConfiguration(config: GeolocationConfiguration) -> bridge.Result_void_ {
|
|
129
129
|
do {
|
|
130
130
|
try self.__implementation.setConfiguration(config: config)
|
|
131
131
|
return bridge.create_Result_void_()
|
|
@@ -155,40 +155,343 @@ open class HybridNitroGeolocationSpec_cxx {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
@inline(__always)
|
|
158
|
-
public final func requestPermission() -> bridge.
|
|
158
|
+
public final func requestPermission(success: bridge.Func_void_PermissionStatus, error: bridge.std__optional_std__function_void_const_LocationError_____error______) -> bridge.Result_void_ {
|
|
159
159
|
do {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
try self.__implementation.requestPermission(success: { () -> (PermissionStatus) -> Void in
|
|
161
|
+
let __wrappedFunction = bridge.wrap_Func_void_PermissionStatus(success)
|
|
162
|
+
return { (__status: PermissionStatus) -> Void in
|
|
163
|
+
__wrappedFunction.call(__status.rawValue)
|
|
164
|
+
}
|
|
165
|
+
}(), error: { () -> ((_ error: LocationError) -> Void)? in
|
|
166
|
+
if bridge.has_value_std__optional_std__function_void_const_LocationError_____error______(error) {
|
|
167
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_LocationError_____error______(error)
|
|
168
|
+
return { () -> (LocationError) -> Void in
|
|
169
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationError(__unwrapped)
|
|
170
|
+
return { (__error: LocationError) -> Void in
|
|
171
|
+
__wrappedFunction.call(__error)
|
|
172
|
+
}
|
|
173
|
+
}()
|
|
174
|
+
} else {
|
|
175
|
+
return nil
|
|
176
|
+
}
|
|
177
|
+
}())
|
|
178
|
+
return bridge.create_Result_void_()
|
|
179
|
+
} catch (let __error) {
|
|
180
|
+
let __exceptionPtr = __error.toCpp()
|
|
181
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@inline(__always)
|
|
186
|
+
public final func hasServicesEnabled() -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
187
|
+
do {
|
|
188
|
+
let __result = try self.__implementation.hasServicesEnabled()
|
|
189
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
190
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
191
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
164
192
|
__result
|
|
165
193
|
.then({ __result in __promiseHolder.resolve(__result) })
|
|
166
194
|
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
167
195
|
return __promise
|
|
168
196
|
}()
|
|
169
|
-
return bridge.
|
|
197
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
170
198
|
} catch (let __error) {
|
|
171
199
|
let __exceptionPtr = __error.toCpp()
|
|
172
|
-
return bridge.
|
|
200
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@inline(__always)
|
|
205
|
+
public final func getProviderStatus() -> bridge.Result_std__shared_ptr_Promise_LocationProviderStatus___ {
|
|
206
|
+
do {
|
|
207
|
+
let __result = try self.__implementation.getProviderStatus()
|
|
208
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_LocationProviderStatus__ in
|
|
209
|
+
let __promise = bridge.create_std__shared_ptr_Promise_LocationProviderStatus__()
|
|
210
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_LocationProviderStatus__(__promise)
|
|
211
|
+
__result
|
|
212
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
213
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
214
|
+
return __promise
|
|
215
|
+
}()
|
|
216
|
+
return bridge.create_Result_std__shared_ptr_Promise_LocationProviderStatus___(__resultCpp)
|
|
217
|
+
} catch (let __error) {
|
|
218
|
+
let __exceptionPtr = __error.toCpp()
|
|
219
|
+
return bridge.create_Result_std__shared_ptr_Promise_LocationProviderStatus___(__exceptionPtr)
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@inline(__always)
|
|
224
|
+
public final func getLocationAvailability() -> bridge.Result_std__shared_ptr_Promise_LocationAvailability___ {
|
|
225
|
+
do {
|
|
226
|
+
let __result = try self.__implementation.getLocationAvailability()
|
|
227
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_LocationAvailability__ in
|
|
228
|
+
let __promise = bridge.create_std__shared_ptr_Promise_LocationAvailability__()
|
|
229
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_LocationAvailability__(__promise)
|
|
230
|
+
__result
|
|
231
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
232
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
233
|
+
return __promise
|
|
234
|
+
}()
|
|
235
|
+
return bridge.create_Result_std__shared_ptr_Promise_LocationAvailability___(__resultCpp)
|
|
236
|
+
} catch (let __error) {
|
|
237
|
+
let __exceptionPtr = __error.toCpp()
|
|
238
|
+
return bridge.create_Result_std__shared_ptr_Promise_LocationAvailability___(__exceptionPtr)
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@inline(__always)
|
|
243
|
+
public final func requestLocationSettings(success: bridge.Func_void_LocationProviderStatus, error: bridge.std__optional_std__function_void_const_LocationError_____error______, options: bridge.std__optional_LocationSettingsOptions_) -> bridge.Result_void_ {
|
|
244
|
+
do {
|
|
245
|
+
try self.__implementation.requestLocationSettings(success: { () -> (LocationProviderStatus) -> Void in
|
|
246
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationProviderStatus(success)
|
|
247
|
+
return { (__status: LocationProviderStatus) -> Void in
|
|
248
|
+
__wrappedFunction.call(__status)
|
|
249
|
+
}
|
|
250
|
+
}(), error: { () -> ((_ error: LocationError) -> Void)? in
|
|
251
|
+
if bridge.has_value_std__optional_std__function_void_const_LocationError_____error______(error) {
|
|
252
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_LocationError_____error______(error)
|
|
253
|
+
return { () -> (LocationError) -> Void in
|
|
254
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationError(__unwrapped)
|
|
255
|
+
return { (__error: LocationError) -> Void in
|
|
256
|
+
__wrappedFunction.call(__error)
|
|
257
|
+
}
|
|
258
|
+
}()
|
|
259
|
+
} else {
|
|
260
|
+
return nil
|
|
261
|
+
}
|
|
262
|
+
}(), options: options.value)
|
|
263
|
+
return bridge.create_Result_void_()
|
|
264
|
+
} catch (let __error) {
|
|
265
|
+
let __exceptionPtr = __error.toCpp()
|
|
266
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
173
267
|
}
|
|
174
268
|
}
|
|
175
269
|
|
|
176
270
|
@inline(__always)
|
|
177
|
-
public final func
|
|
271
|
+
public final func getAccuracyAuthorization() -> bridge.Result_std__shared_ptr_Promise_AccuracyAuthorization___ {
|
|
178
272
|
do {
|
|
179
|
-
let __result = try self.__implementation.
|
|
180
|
-
let __resultCpp = { () -> bridge.
|
|
181
|
-
let __promise = bridge.
|
|
182
|
-
let __promiseHolder = bridge.
|
|
273
|
+
let __result = try self.__implementation.getAccuracyAuthorization()
|
|
274
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_AccuracyAuthorization__ in
|
|
275
|
+
let __promise = bridge.create_std__shared_ptr_Promise_AccuracyAuthorization__()
|
|
276
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_AccuracyAuthorization__(__promise)
|
|
183
277
|
__result
|
|
184
278
|
.then({ __result in __promiseHolder.resolve(__result) })
|
|
185
279
|
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
186
280
|
return __promise
|
|
187
281
|
}()
|
|
188
|
-
return bridge.
|
|
282
|
+
return bridge.create_Result_std__shared_ptr_Promise_AccuracyAuthorization___(__resultCpp)
|
|
283
|
+
} catch (let __error) {
|
|
284
|
+
let __exceptionPtr = __error.toCpp()
|
|
285
|
+
return bridge.create_Result_std__shared_ptr_Promise_AccuracyAuthorization___(__exceptionPtr)
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@inline(__always)
|
|
290
|
+
public final func requestTemporaryFullAccuracy(purposeKey: std.string, success: bridge.Func_void_AccuracyAuthorization, error: bridge.std__optional_std__function_void_const_LocationError_____error______) -> bridge.Result_void_ {
|
|
291
|
+
do {
|
|
292
|
+
try self.__implementation.requestTemporaryFullAccuracy(purposeKey: String(purposeKey), success: { () -> (AccuracyAuthorization) -> Void in
|
|
293
|
+
let __wrappedFunction = bridge.wrap_Func_void_AccuracyAuthorization(success)
|
|
294
|
+
return { (__authorization: AccuracyAuthorization) -> Void in
|
|
295
|
+
__wrappedFunction.call(__authorization.rawValue)
|
|
296
|
+
}
|
|
297
|
+
}(), error: { () -> ((_ error: LocationError) -> Void)? in
|
|
298
|
+
if bridge.has_value_std__optional_std__function_void_const_LocationError_____error______(error) {
|
|
299
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_LocationError_____error______(error)
|
|
300
|
+
return { () -> (LocationError) -> Void in
|
|
301
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationError(__unwrapped)
|
|
302
|
+
return { (__error: LocationError) -> Void in
|
|
303
|
+
__wrappedFunction.call(__error)
|
|
304
|
+
}
|
|
305
|
+
}()
|
|
306
|
+
} else {
|
|
307
|
+
return nil
|
|
308
|
+
}
|
|
309
|
+
}())
|
|
310
|
+
return bridge.create_Result_void_()
|
|
311
|
+
} catch (let __error) {
|
|
312
|
+
let __exceptionPtr = __error.toCpp()
|
|
313
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
@inline(__always)
|
|
318
|
+
public final func getCurrentPosition(success: bridge.Func_void_GeolocationResponse, error: bridge.std__optional_std__function_void_const_LocationError_____error______, options: bridge.std__optional_LocationRequestOptions_) -> bridge.Result_void_ {
|
|
319
|
+
do {
|
|
320
|
+
try self.__implementation.getCurrentPosition(success: { () -> (GeolocationResponse) -> Void in
|
|
321
|
+
let __wrappedFunction = bridge.wrap_Func_void_GeolocationResponse(success)
|
|
322
|
+
return { (__position: GeolocationResponse) -> Void in
|
|
323
|
+
__wrappedFunction.call(__position)
|
|
324
|
+
}
|
|
325
|
+
}(), error: { () -> ((_ error: LocationError) -> Void)? in
|
|
326
|
+
if bridge.has_value_std__optional_std__function_void_const_LocationError_____error______(error) {
|
|
327
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_LocationError_____error______(error)
|
|
328
|
+
return { () -> (LocationError) -> Void in
|
|
329
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationError(__unwrapped)
|
|
330
|
+
return { (__error: LocationError) -> Void in
|
|
331
|
+
__wrappedFunction.call(__error)
|
|
332
|
+
}
|
|
333
|
+
}()
|
|
334
|
+
} else {
|
|
335
|
+
return nil
|
|
336
|
+
}
|
|
337
|
+
}(), options: options.value)
|
|
338
|
+
return bridge.create_Result_void_()
|
|
339
|
+
} catch (let __error) {
|
|
340
|
+
let __exceptionPtr = __error.toCpp()
|
|
341
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
@inline(__always)
|
|
346
|
+
public final func getLastKnownPosition(success: bridge.Func_void_GeolocationResponse, error: bridge.std__optional_std__function_void_const_LocationError_____error______, options: bridge.std__optional_LocationRequestOptions_) -> bridge.Result_void_ {
|
|
347
|
+
do {
|
|
348
|
+
try self.__implementation.getLastKnownPosition(success: { () -> (GeolocationResponse) -> Void in
|
|
349
|
+
let __wrappedFunction = bridge.wrap_Func_void_GeolocationResponse(success)
|
|
350
|
+
return { (__position: GeolocationResponse) -> Void in
|
|
351
|
+
__wrappedFunction.call(__position)
|
|
352
|
+
}
|
|
353
|
+
}(), error: { () -> ((_ error: LocationError) -> Void)? in
|
|
354
|
+
if bridge.has_value_std__optional_std__function_void_const_LocationError_____error______(error) {
|
|
355
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_LocationError_____error______(error)
|
|
356
|
+
return { () -> (LocationError) -> Void in
|
|
357
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationError(__unwrapped)
|
|
358
|
+
return { (__error: LocationError) -> Void in
|
|
359
|
+
__wrappedFunction.call(__error)
|
|
360
|
+
}
|
|
361
|
+
}()
|
|
362
|
+
} else {
|
|
363
|
+
return nil
|
|
364
|
+
}
|
|
365
|
+
}(), options: options.value)
|
|
366
|
+
return bridge.create_Result_void_()
|
|
367
|
+
} catch (let __error) {
|
|
368
|
+
let __exceptionPtr = __error.toCpp()
|
|
369
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
@inline(__always)
|
|
374
|
+
public final func geocode(address: std.string, success: bridge.Func_void_std__vector_GeocodedLocation_, error: bridge.std__optional_std__function_void_const_LocationError_____error______) -> bridge.Result_void_ {
|
|
375
|
+
do {
|
|
376
|
+
try self.__implementation.geocode(address: String(address), success: { () -> ([GeocodedLocation]) -> Void in
|
|
377
|
+
let __wrappedFunction = bridge.wrap_Func_void_std__vector_GeocodedLocation_(success)
|
|
378
|
+
return { (__locations: [GeocodedLocation]) -> Void in
|
|
379
|
+
__wrappedFunction.call({ () -> bridge.std__vector_GeocodedLocation_ in
|
|
380
|
+
var __vector = bridge.create_std__vector_GeocodedLocation_(__locations.count)
|
|
381
|
+
for __item in __locations {
|
|
382
|
+
__vector.push_back(__item)
|
|
383
|
+
}
|
|
384
|
+
return __vector
|
|
385
|
+
}())
|
|
386
|
+
}
|
|
387
|
+
}(), error: { () -> ((_ error: LocationError) -> Void)? in
|
|
388
|
+
if bridge.has_value_std__optional_std__function_void_const_LocationError_____error______(error) {
|
|
389
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_LocationError_____error______(error)
|
|
390
|
+
return { () -> (LocationError) -> Void in
|
|
391
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationError(__unwrapped)
|
|
392
|
+
return { (__error: LocationError) -> Void in
|
|
393
|
+
__wrappedFunction.call(__error)
|
|
394
|
+
}
|
|
395
|
+
}()
|
|
396
|
+
} else {
|
|
397
|
+
return nil
|
|
398
|
+
}
|
|
399
|
+
}())
|
|
400
|
+
return bridge.create_Result_void_()
|
|
401
|
+
} catch (let __error) {
|
|
402
|
+
let __exceptionPtr = __error.toCpp()
|
|
403
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
@inline(__always)
|
|
408
|
+
public final func reverseGeocode(coords: GeocodingCoordinates, success: bridge.Func_void_std__vector_ReverseGeocodedAddress_, error: bridge.std__optional_std__function_void_const_LocationError_____error______) -> bridge.Result_void_ {
|
|
409
|
+
do {
|
|
410
|
+
try self.__implementation.reverseGeocode(coords: coords, success: { () -> ([ReverseGeocodedAddress]) -> Void in
|
|
411
|
+
let __wrappedFunction = bridge.wrap_Func_void_std__vector_ReverseGeocodedAddress_(success)
|
|
412
|
+
return { (__addresses: [ReverseGeocodedAddress]) -> Void in
|
|
413
|
+
__wrappedFunction.call({ () -> bridge.std__vector_ReverseGeocodedAddress_ in
|
|
414
|
+
var __vector = bridge.create_std__vector_ReverseGeocodedAddress_(__addresses.count)
|
|
415
|
+
for __item in __addresses {
|
|
416
|
+
__vector.push_back(__item)
|
|
417
|
+
}
|
|
418
|
+
return __vector
|
|
419
|
+
}())
|
|
420
|
+
}
|
|
421
|
+
}(), error: { () -> ((_ error: LocationError) -> Void)? in
|
|
422
|
+
if bridge.has_value_std__optional_std__function_void_const_LocationError_____error______(error) {
|
|
423
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_LocationError_____error______(error)
|
|
424
|
+
return { () -> (LocationError) -> Void in
|
|
425
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationError(__unwrapped)
|
|
426
|
+
return { (__error: LocationError) -> Void in
|
|
427
|
+
__wrappedFunction.call(__error)
|
|
428
|
+
}
|
|
429
|
+
}()
|
|
430
|
+
} else {
|
|
431
|
+
return nil
|
|
432
|
+
}
|
|
433
|
+
}())
|
|
434
|
+
return bridge.create_Result_void_()
|
|
435
|
+
} catch (let __error) {
|
|
436
|
+
let __exceptionPtr = __error.toCpp()
|
|
437
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
@inline(__always)
|
|
442
|
+
public final func getHeading(success: bridge.Func_void_Heading, error: bridge.std__optional_std__function_void_const_LocationError_____error______) -> bridge.Result_void_ {
|
|
443
|
+
do {
|
|
444
|
+
try self.__implementation.getHeading(success: { () -> (Heading) -> Void in
|
|
445
|
+
let __wrappedFunction = bridge.wrap_Func_void_Heading(success)
|
|
446
|
+
return { (__heading: Heading) -> Void in
|
|
447
|
+
__wrappedFunction.call(__heading)
|
|
448
|
+
}
|
|
449
|
+
}(), error: { () -> ((_ error: LocationError) -> Void)? in
|
|
450
|
+
if bridge.has_value_std__optional_std__function_void_const_LocationError_____error______(error) {
|
|
451
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_LocationError_____error______(error)
|
|
452
|
+
return { () -> (LocationError) -> Void in
|
|
453
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationError(__unwrapped)
|
|
454
|
+
return { (__error: LocationError) -> Void in
|
|
455
|
+
__wrappedFunction.call(__error)
|
|
456
|
+
}
|
|
457
|
+
}()
|
|
458
|
+
} else {
|
|
459
|
+
return nil
|
|
460
|
+
}
|
|
461
|
+
}())
|
|
462
|
+
return bridge.create_Result_void_()
|
|
463
|
+
} catch (let __error) {
|
|
464
|
+
let __exceptionPtr = __error.toCpp()
|
|
465
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
@inline(__always)
|
|
470
|
+
public final func watchHeading(success: bridge.Func_void_Heading, error: bridge.std__optional_std__function_void_const_LocationError_____error______, options: bridge.std__optional_HeadingOptions_) -> bridge.Result_std__string_ {
|
|
471
|
+
do {
|
|
472
|
+
let __result = try self.__implementation.watchHeading(success: { () -> (Heading) -> Void in
|
|
473
|
+
let __wrappedFunction = bridge.wrap_Func_void_Heading(success)
|
|
474
|
+
return { (__heading: Heading) -> Void in
|
|
475
|
+
__wrappedFunction.call(__heading)
|
|
476
|
+
}
|
|
477
|
+
}(), error: { () -> ((_ error: LocationError) -> Void)? in
|
|
478
|
+
if bridge.has_value_std__optional_std__function_void_const_LocationError_____error______(error) {
|
|
479
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_LocationError_____error______(error)
|
|
480
|
+
return { () -> (LocationError) -> Void in
|
|
481
|
+
let __wrappedFunction = bridge.wrap_Func_void_LocationError(__unwrapped)
|
|
482
|
+
return { (__error: LocationError) -> Void in
|
|
483
|
+
__wrappedFunction.call(__error)
|
|
484
|
+
}
|
|
485
|
+
}()
|
|
486
|
+
} else {
|
|
487
|
+
return nil
|
|
488
|
+
}
|
|
489
|
+
}(), options: options.value)
|
|
490
|
+
let __resultCpp = std.string(__result)
|
|
491
|
+
return bridge.create_Result_std__string_(__resultCpp)
|
|
189
492
|
} catch (let __error) {
|
|
190
493
|
let __exceptionPtr = __error.toCpp()
|
|
191
|
-
return bridge.
|
|
494
|
+
return bridge.create_Result_std__string_(__exceptionPtr)
|
|
192
495
|
}
|
|
193
496
|
}
|
|
194
497
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IOSAccuracyPreset.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `IOSAccuracyPreset`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias IOSAccuracyPreset = margelo.nitro.nitrogeolocation.IOSAccuracyPreset
|
|
12
|
+
|
|
13
|
+
public extension IOSAccuracyPreset {
|
|
14
|
+
/**
|
|
15
|
+
* Get a IOSAccuracyPreset for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "bestForNavigation":
|
|
21
|
+
self = .bestfornavigation
|
|
22
|
+
case "best":
|
|
23
|
+
self = .best
|
|
24
|
+
case "nearestTenMeters":
|
|
25
|
+
self = .nearesttenmeters
|
|
26
|
+
case "hundredMeters":
|
|
27
|
+
self = .hundredmeters
|
|
28
|
+
case "kilometer":
|
|
29
|
+
self = .kilometer
|
|
30
|
+
case "threeKilometers":
|
|
31
|
+
self = .threekilometers
|
|
32
|
+
case "reduced":
|
|
33
|
+
self = .reduced
|
|
34
|
+
default:
|
|
35
|
+
return nil
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get the String value this IOSAccuracyPreset represents.
|
|
41
|
+
*/
|
|
42
|
+
var stringValue: String {
|
|
43
|
+
switch self {
|
|
44
|
+
case .bestfornavigation:
|
|
45
|
+
return "bestForNavigation"
|
|
46
|
+
case .best:
|
|
47
|
+
return "best"
|
|
48
|
+
case .nearesttenmeters:
|
|
49
|
+
return "nearestTenMeters"
|
|
50
|
+
case .hundredmeters:
|
|
51
|
+
return "hundredMeters"
|
|
52
|
+
case .kilometer:
|
|
53
|
+
return "kilometer"
|
|
54
|
+
case .threekilometers:
|
|
55
|
+
return "threeKilometers"
|
|
56
|
+
case .reduced:
|
|
57
|
+
return "reduced"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IOSActivityType.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `IOSActivityType`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias IOSActivityType = margelo.nitro.nitrogeolocation.IOSActivityType
|
|
12
|
+
|
|
13
|
+
public extension IOSActivityType {
|
|
14
|
+
/**
|
|
15
|
+
* Get a IOSActivityType for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "other":
|
|
21
|
+
self = .other
|
|
22
|
+
case "automotiveNavigation":
|
|
23
|
+
self = .automotivenavigation
|
|
24
|
+
case "fitness":
|
|
25
|
+
self = .fitness
|
|
26
|
+
case "otherNavigation":
|
|
27
|
+
self = .othernavigation
|
|
28
|
+
case "airborne":
|
|
29
|
+
self = .airborne
|
|
30
|
+
default:
|
|
31
|
+
return nil
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the String value this IOSActivityType represents.
|
|
37
|
+
*/
|
|
38
|
+
var stringValue: String {
|
|
39
|
+
switch self {
|
|
40
|
+
case .other:
|
|
41
|
+
return "other"
|
|
42
|
+
case .automotivenavigation:
|
|
43
|
+
return "automotiveNavigation"
|
|
44
|
+
case .fitness:
|
|
45
|
+
return "fitness"
|
|
46
|
+
case .othernavigation:
|
|
47
|
+
return "otherNavigation"
|
|
48
|
+
case .airborne:
|
|
49
|
+
return "airborne"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// LocationAccuracyOptions.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `LocationAccuracyOptions`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias LocationAccuracyOptions = margelo.nitro.nitrogeolocation.LocationAccuracyOptions
|
|
14
|
+
|
|
15
|
+
public extension LocationAccuracyOptions {
|
|
16
|
+
private typealias bridge = margelo.nitro.nitrogeolocation.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `LocationAccuracyOptions`.
|
|
20
|
+
*/
|
|
21
|
+
init(android: AndroidAccuracyPreset?, ios: IOSAccuracyPreset?) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_AndroidAccuracyPreset_ in
|
|
23
|
+
if let __unwrappedValue = android {
|
|
24
|
+
return bridge.create_std__optional_AndroidAccuracyPreset_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_IOSAccuracyPreset_ in
|
|
29
|
+
if let __unwrappedValue = ios {
|
|
30
|
+
return bridge.create_std__optional_IOSAccuracyPreset_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}())
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@inline(__always)
|
|
38
|
+
var android: AndroidAccuracyPreset? {
|
|
39
|
+
return self.__android.value
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@inline(__always)
|
|
43
|
+
var ios: IOSAccuracyPreset? {
|
|
44
|
+
return self.__ios.value
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// LocationAvailability.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `LocationAvailability`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias LocationAvailability = margelo.nitro.nitrogeolocation.LocationAvailability
|
|
14
|
+
|
|
15
|
+
public extension LocationAvailability {
|
|
16
|
+
private typealias bridge = margelo.nitro.nitrogeolocation.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `LocationAvailability`.
|
|
20
|
+
*/
|
|
21
|
+
init(available: Bool, reason: String?) {
|
|
22
|
+
self.init(available, { () -> bridge.std__optional_std__string_ in
|
|
23
|
+
if let __unwrappedValue = reason {
|
|
24
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}())
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@inline(__always)
|
|
32
|
+
var available: Bool {
|
|
33
|
+
return self.__available
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@inline(__always)
|
|
37
|
+
var reason: String? {
|
|
38
|
+
return { () -> String? in
|
|
39
|
+
if bridge.has_value_std__optional_std__string_(self.__reason) {
|
|
40
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__reason)
|
|
41
|
+
return String(__unwrapped)
|
|
42
|
+
} else {
|
|
43
|
+
return nil
|
|
44
|
+
}
|
|
45
|
+
}()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// LocationProviderStatus.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an instance of `LocationProviderStatus`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias LocationProviderStatus = margelo.nitro.nitrogeolocation.LocationProviderStatus
|
|
14
|
+
|
|
15
|
+
public extension LocationProviderStatus {
|
|
16
|
+
private typealias bridge = margelo.nitro.nitrogeolocation.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `LocationProviderStatus`.
|
|
20
|
+
*/
|
|
21
|
+
init(locationServicesEnabled: Bool, backgroundModeEnabled: Bool, gpsAvailable: Bool?, networkAvailable: Bool?, passiveAvailable: Bool?, googleLocationAccuracyEnabled: Bool?) {
|
|
22
|
+
self.init(locationServicesEnabled, backgroundModeEnabled, { () -> bridge.std__optional_bool_ in
|
|
23
|
+
if let __unwrappedValue = gpsAvailable {
|
|
24
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
29
|
+
if let __unwrappedValue = networkAvailable {
|
|
30
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
35
|
+
if let __unwrappedValue = passiveAvailable {
|
|
36
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_bool_ in
|
|
41
|
+
if let __unwrappedValue = googleLocationAccuracyEnabled {
|
|
42
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}())
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@inline(__always)
|
|
50
|
+
var locationServicesEnabled: Bool {
|
|
51
|
+
return self.__locationServicesEnabled
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@inline(__always)
|
|
55
|
+
var backgroundModeEnabled: Bool {
|
|
56
|
+
return self.__backgroundModeEnabled
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@inline(__always)
|
|
60
|
+
var gpsAvailable: Bool? {
|
|
61
|
+
return { () -> Bool? in
|
|
62
|
+
if bridge.has_value_std__optional_bool_(self.__gpsAvailable) {
|
|
63
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__gpsAvailable)
|
|
64
|
+
return __unwrapped
|
|
65
|
+
} else {
|
|
66
|
+
return nil
|
|
67
|
+
}
|
|
68
|
+
}()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@inline(__always)
|
|
72
|
+
var networkAvailable: Bool? {
|
|
73
|
+
return { () -> Bool? in
|
|
74
|
+
if bridge.has_value_std__optional_bool_(self.__networkAvailable) {
|
|
75
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__networkAvailable)
|
|
76
|
+
return __unwrapped
|
|
77
|
+
} else {
|
|
78
|
+
return nil
|
|
79
|
+
}
|
|
80
|
+
}()
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@inline(__always)
|
|
84
|
+
var passiveAvailable: Bool? {
|
|
85
|
+
return { () -> Bool? in
|
|
86
|
+
if bridge.has_value_std__optional_bool_(self.__passiveAvailable) {
|
|
87
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__passiveAvailable)
|
|
88
|
+
return __unwrapped
|
|
89
|
+
} else {
|
|
90
|
+
return nil
|
|
91
|
+
}
|
|
92
|
+
}()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@inline(__always)
|
|
96
|
+
var googleLocationAccuracyEnabled: Bool? {
|
|
97
|
+
return { () -> Bool? in
|
|
98
|
+
if bridge.has_value_std__optional_bool_(self.__googleLocationAccuracyEnabled) {
|
|
99
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__googleLocationAccuracyEnabled)
|
|
100
|
+
return __unwrapped
|
|
101
|
+
} else {
|
|
102
|
+
return nil
|
|
103
|
+
}
|
|
104
|
+
}()
|
|
105
|
+
}
|
|
106
|
+
}
|