react-native-nitro-geolocation 1.1.4 → 1.2.1
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 +97 -9
- 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 +1027 -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 +292 -18
- 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 +108 -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
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JLocationProviderUsed.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "LocationProviderUsed.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "LocationProviderUsed" and the the Kotlin enum "LocationProviderUsed".
|
|
19
|
+
*/
|
|
20
|
+
struct JLocationProviderUsed final: public jni::JavaClass<JLocationProviderUsed> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/LocationProviderUsed;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum LocationProviderUsed.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
LocationProviderUsed toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<LocationProviderUsed>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JLocationProviderUsed> fromCpp(LocationProviderUsed value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case LocationProviderUsed::PASSIVE:
|
|
46
|
+
static const auto fieldPASSIVE = clazz->getStaticField<JLocationProviderUsed>("PASSIVE");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldPASSIVE);
|
|
48
|
+
case LocationProviderUsed::UNKNOWN:
|
|
49
|
+
static const auto fieldUNKNOWN = clazz->getStaticField<JLocationProviderUsed>("UNKNOWN");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldUNKNOWN);
|
|
51
|
+
case LocationProviderUsed::FUSED:
|
|
52
|
+
static const auto fieldFUSED = clazz->getStaticField<JLocationProviderUsed>("FUSED");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldFUSED);
|
|
54
|
+
case LocationProviderUsed::GPS:
|
|
55
|
+
static const auto fieldGPS = clazz->getStaticField<JLocationProviderUsed>("GPS");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldGPS);
|
|
57
|
+
case LocationProviderUsed::NETWORK:
|
|
58
|
+
static const auto fieldNETWORK = clazz->getStaticField<JLocationProviderUsed>("NETWORK");
|
|
59
|
+
return clazz->getStaticFieldValue(fieldNETWORK);
|
|
60
|
+
default:
|
|
61
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
62
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
11
|
#include "LocationRequestOptions.hpp"
|
|
12
12
|
|
|
13
|
+
#include "AndroidAccuracyPreset.hpp"
|
|
14
|
+
#include "AndroidGranularity.hpp"
|
|
15
|
+
#include "IOSAccuracyPreset.hpp"
|
|
16
|
+
#include "IOSActivityType.hpp"
|
|
17
|
+
#include "JAndroidAccuracyPreset.hpp"
|
|
18
|
+
#include "JAndroidGranularity.hpp"
|
|
19
|
+
#include "JIOSAccuracyPreset.hpp"
|
|
20
|
+
#include "JIOSActivityType.hpp"
|
|
21
|
+
#include "JLocationAccuracyOptions.hpp"
|
|
22
|
+
#include "LocationAccuracyOptions.hpp"
|
|
13
23
|
#include <optional>
|
|
14
24
|
|
|
15
25
|
namespace margelo::nitro::nitrogeolocation {
|
|
@@ -37,22 +47,49 @@ namespace margelo::nitro::nitrogeolocation {
|
|
|
37
47
|
jni::local_ref<jni::JDouble> maximumAge = this->getFieldValue(fieldMaximumAge);
|
|
38
48
|
static const auto fieldEnableHighAccuracy = clazz->getField<jni::JBoolean>("enableHighAccuracy");
|
|
39
49
|
jni::local_ref<jni::JBoolean> enableHighAccuracy = this->getFieldValue(fieldEnableHighAccuracy);
|
|
50
|
+
static const auto fieldAccuracy = clazz->getField<JLocationAccuracyOptions>("accuracy");
|
|
51
|
+
jni::local_ref<JLocationAccuracyOptions> accuracy = this->getFieldValue(fieldAccuracy);
|
|
40
52
|
static const auto fieldInterval = clazz->getField<jni::JDouble>("interval");
|
|
41
53
|
jni::local_ref<jni::JDouble> interval = this->getFieldValue(fieldInterval);
|
|
42
54
|
static const auto fieldFastestInterval = clazz->getField<jni::JDouble>("fastestInterval");
|
|
43
55
|
jni::local_ref<jni::JDouble> fastestInterval = this->getFieldValue(fieldFastestInterval);
|
|
44
56
|
static const auto fieldDistanceFilter = clazz->getField<jni::JDouble>("distanceFilter");
|
|
45
57
|
jni::local_ref<jni::JDouble> distanceFilter = this->getFieldValue(fieldDistanceFilter);
|
|
58
|
+
static const auto fieldGranularity = clazz->getField<JAndroidGranularity>("granularity");
|
|
59
|
+
jni::local_ref<JAndroidGranularity> granularity = this->getFieldValue(fieldGranularity);
|
|
60
|
+
static const auto fieldWaitForAccurateLocation = clazz->getField<jni::JBoolean>("waitForAccurateLocation");
|
|
61
|
+
jni::local_ref<jni::JBoolean> waitForAccurateLocation = this->getFieldValue(fieldWaitForAccurateLocation);
|
|
62
|
+
static const auto fieldMaxUpdateAge = clazz->getField<jni::JDouble>("maxUpdateAge");
|
|
63
|
+
jni::local_ref<jni::JDouble> maxUpdateAge = this->getFieldValue(fieldMaxUpdateAge);
|
|
64
|
+
static const auto fieldMaxUpdateDelay = clazz->getField<jni::JDouble>("maxUpdateDelay");
|
|
65
|
+
jni::local_ref<jni::JDouble> maxUpdateDelay = this->getFieldValue(fieldMaxUpdateDelay);
|
|
66
|
+
static const auto fieldMaxUpdates = clazz->getField<jni::JDouble>("maxUpdates");
|
|
67
|
+
jni::local_ref<jni::JDouble> maxUpdates = this->getFieldValue(fieldMaxUpdates);
|
|
46
68
|
static const auto fieldUseSignificantChanges = clazz->getField<jni::JBoolean>("useSignificantChanges");
|
|
47
69
|
jni::local_ref<jni::JBoolean> useSignificantChanges = this->getFieldValue(fieldUseSignificantChanges);
|
|
70
|
+
static const auto fieldActivityType = clazz->getField<JIOSActivityType>("activityType");
|
|
71
|
+
jni::local_ref<JIOSActivityType> activityType = this->getFieldValue(fieldActivityType);
|
|
72
|
+
static const auto fieldPausesLocationUpdatesAutomatically = clazz->getField<jni::JBoolean>("pausesLocationUpdatesAutomatically");
|
|
73
|
+
jni::local_ref<jni::JBoolean> pausesLocationUpdatesAutomatically = this->getFieldValue(fieldPausesLocationUpdatesAutomatically);
|
|
74
|
+
static const auto fieldShowsBackgroundLocationIndicator = clazz->getField<jni::JBoolean>("showsBackgroundLocationIndicator");
|
|
75
|
+
jni::local_ref<jni::JBoolean> showsBackgroundLocationIndicator = this->getFieldValue(fieldShowsBackgroundLocationIndicator);
|
|
48
76
|
return LocationRequestOptions(
|
|
49
77
|
timeout != nullptr ? std::make_optional(timeout->value()) : std::nullopt,
|
|
50
78
|
maximumAge != nullptr ? std::make_optional(maximumAge->value()) : std::nullopt,
|
|
51
79
|
enableHighAccuracy != nullptr ? std::make_optional(static_cast<bool>(enableHighAccuracy->value())) : std::nullopt,
|
|
80
|
+
accuracy != nullptr ? std::make_optional(accuracy->toCpp()) : std::nullopt,
|
|
52
81
|
interval != nullptr ? std::make_optional(interval->value()) : std::nullopt,
|
|
53
82
|
fastestInterval != nullptr ? std::make_optional(fastestInterval->value()) : std::nullopt,
|
|
54
83
|
distanceFilter != nullptr ? std::make_optional(distanceFilter->value()) : std::nullopt,
|
|
55
|
-
|
|
84
|
+
granularity != nullptr ? std::make_optional(granularity->toCpp()) : std::nullopt,
|
|
85
|
+
waitForAccurateLocation != nullptr ? std::make_optional(static_cast<bool>(waitForAccurateLocation->value())) : std::nullopt,
|
|
86
|
+
maxUpdateAge != nullptr ? std::make_optional(maxUpdateAge->value()) : std::nullopt,
|
|
87
|
+
maxUpdateDelay != nullptr ? std::make_optional(maxUpdateDelay->value()) : std::nullopt,
|
|
88
|
+
maxUpdates != nullptr ? std::make_optional(maxUpdates->value()) : std::nullopt,
|
|
89
|
+
useSignificantChanges != nullptr ? std::make_optional(static_cast<bool>(useSignificantChanges->value())) : std::nullopt,
|
|
90
|
+
activityType != nullptr ? std::make_optional(activityType->toCpp()) : std::nullopt,
|
|
91
|
+
pausesLocationUpdatesAutomatically != nullptr ? std::make_optional(static_cast<bool>(pausesLocationUpdatesAutomatically->value())) : std::nullopt,
|
|
92
|
+
showsBackgroundLocationIndicator != nullptr ? std::make_optional(static_cast<bool>(showsBackgroundLocationIndicator->value())) : std::nullopt
|
|
56
93
|
);
|
|
57
94
|
}
|
|
58
95
|
|
|
@@ -62,7 +99,7 @@ namespace margelo::nitro::nitrogeolocation {
|
|
|
62
99
|
*/
|
|
63
100
|
[[maybe_unused]]
|
|
64
101
|
static jni::local_ref<JLocationRequestOptions::javaobject> fromCpp(const LocationRequestOptions& value) {
|
|
65
|
-
using JSignature = JLocationRequestOptions(jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>);
|
|
102
|
+
using JSignature = JLocationRequestOptions(jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JLocationAccuracyOptions>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<JAndroidGranularity>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JIOSActivityType>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>);
|
|
66
103
|
static const auto clazz = javaClassStatic();
|
|
67
104
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
68
105
|
return create(
|
|
@@ -70,10 +107,19 @@ namespace margelo::nitro::nitrogeolocation {
|
|
|
70
107
|
value.timeout.has_value() ? jni::JDouble::valueOf(value.timeout.value()) : nullptr,
|
|
71
108
|
value.maximumAge.has_value() ? jni::JDouble::valueOf(value.maximumAge.value()) : nullptr,
|
|
72
109
|
value.enableHighAccuracy.has_value() ? jni::JBoolean::valueOf(value.enableHighAccuracy.value()) : nullptr,
|
|
110
|
+
value.accuracy.has_value() ? JLocationAccuracyOptions::fromCpp(value.accuracy.value()) : nullptr,
|
|
73
111
|
value.interval.has_value() ? jni::JDouble::valueOf(value.interval.value()) : nullptr,
|
|
74
112
|
value.fastestInterval.has_value() ? jni::JDouble::valueOf(value.fastestInterval.value()) : nullptr,
|
|
75
113
|
value.distanceFilter.has_value() ? jni::JDouble::valueOf(value.distanceFilter.value()) : nullptr,
|
|
76
|
-
value.
|
|
114
|
+
value.granularity.has_value() ? JAndroidGranularity::fromCpp(value.granularity.value()) : nullptr,
|
|
115
|
+
value.waitForAccurateLocation.has_value() ? jni::JBoolean::valueOf(value.waitForAccurateLocation.value()) : nullptr,
|
|
116
|
+
value.maxUpdateAge.has_value() ? jni::JDouble::valueOf(value.maxUpdateAge.value()) : nullptr,
|
|
117
|
+
value.maxUpdateDelay.has_value() ? jni::JDouble::valueOf(value.maxUpdateDelay.value()) : nullptr,
|
|
118
|
+
value.maxUpdates.has_value() ? jni::JDouble::valueOf(value.maxUpdates.value()) : nullptr,
|
|
119
|
+
value.useSignificantChanges.has_value() ? jni::JBoolean::valueOf(value.useSignificantChanges.value()) : nullptr,
|
|
120
|
+
value.activityType.has_value() ? JIOSActivityType::fromCpp(value.activityType.value()) : nullptr,
|
|
121
|
+
value.pausesLocationUpdatesAutomatically.has_value() ? jni::JBoolean::valueOf(value.pausesLocationUpdatesAutomatically.value()) : nullptr,
|
|
122
|
+
value.showsBackgroundLocationIndicator.has_value() ? jni::JBoolean::valueOf(value.showsBackgroundLocationIndicator.value()) : nullptr
|
|
77
123
|
);
|
|
78
124
|
}
|
|
79
125
|
};
|
package/nitrogen/generated/android/c++/{JGeolocationOptions.hpp → JLocationSettingsOptions.hpp}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// JLocationSettingsOptions.hpp
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -8,8 +8,14 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <fbjni/fbjni.h>
|
|
11
|
-
#include "
|
|
11
|
+
#include "LocationSettingsOptions.hpp"
|
|
12
12
|
|
|
13
|
+
#include "AndroidAccuracyPreset.hpp"
|
|
14
|
+
#include "IOSAccuracyPreset.hpp"
|
|
15
|
+
#include "JAndroidAccuracyPreset.hpp"
|
|
16
|
+
#include "JIOSAccuracyPreset.hpp"
|
|
17
|
+
#include "JLocationAccuracyOptions.hpp"
|
|
18
|
+
#include "LocationAccuracyOptions.hpp"
|
|
13
19
|
#include <optional>
|
|
14
20
|
|
|
15
21
|
namespace margelo::nitro::nitrogeolocation {
|
|
@@ -17,42 +23,42 @@ namespace margelo::nitro::nitrogeolocation {
|
|
|
17
23
|
using namespace facebook;
|
|
18
24
|
|
|
19
25
|
/**
|
|
20
|
-
* The C++ JNI bridge between the C++ struct "
|
|
26
|
+
* The C++ JNI bridge between the C++ struct "LocationSettingsOptions" and the the Kotlin data class "LocationSettingsOptions".
|
|
21
27
|
*/
|
|
22
|
-
struct
|
|
28
|
+
struct JLocationSettingsOptions final: public jni::JavaClass<JLocationSettingsOptions> {
|
|
23
29
|
public:
|
|
24
|
-
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/
|
|
30
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/LocationSettingsOptions;";
|
|
25
31
|
|
|
26
32
|
public:
|
|
27
33
|
/**
|
|
28
|
-
* Convert this Java/Kotlin-based struct to the C++ struct
|
|
34
|
+
* Convert this Java/Kotlin-based struct to the C++ struct LocationSettingsOptions by copying all values to C++.
|
|
29
35
|
*/
|
|
30
36
|
[[maybe_unused]]
|
|
31
37
|
[[nodiscard]]
|
|
32
|
-
|
|
38
|
+
LocationSettingsOptions toCpp() const {
|
|
33
39
|
static const auto clazz = javaClassStatic();
|
|
34
|
-
static const auto fieldTimeout = clazz->getField<jni::JDouble>("timeout");
|
|
35
|
-
jni::local_ref<jni::JDouble> timeout = this->getFieldValue(fieldTimeout);
|
|
36
|
-
static const auto fieldMaximumAge = clazz->getField<jni::JDouble>("maximumAge");
|
|
37
|
-
jni::local_ref<jni::JDouble> maximumAge = this->getFieldValue(fieldMaximumAge);
|
|
38
40
|
static const auto fieldEnableHighAccuracy = clazz->getField<jni::JBoolean>("enableHighAccuracy");
|
|
39
41
|
jni::local_ref<jni::JBoolean> enableHighAccuracy = this->getFieldValue(fieldEnableHighAccuracy);
|
|
42
|
+
static const auto fieldAccuracy = clazz->getField<JLocationAccuracyOptions>("accuracy");
|
|
43
|
+
jni::local_ref<JLocationAccuracyOptions> accuracy = this->getFieldValue(fieldAccuracy);
|
|
40
44
|
static const auto fieldInterval = clazz->getField<jni::JDouble>("interval");
|
|
41
45
|
jni::local_ref<jni::JDouble> interval = this->getFieldValue(fieldInterval);
|
|
42
46
|
static const auto fieldFastestInterval = clazz->getField<jni::JDouble>("fastestInterval");
|
|
43
47
|
jni::local_ref<jni::JDouble> fastestInterval = this->getFieldValue(fieldFastestInterval);
|
|
44
48
|
static const auto fieldDistanceFilter = clazz->getField<jni::JDouble>("distanceFilter");
|
|
45
49
|
jni::local_ref<jni::JDouble> distanceFilter = this->getFieldValue(fieldDistanceFilter);
|
|
46
|
-
static const auto
|
|
47
|
-
jni::local_ref<jni::JBoolean>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
static const auto fieldAlwaysShow = clazz->getField<jni::JBoolean>("alwaysShow");
|
|
51
|
+
jni::local_ref<jni::JBoolean> alwaysShow = this->getFieldValue(fieldAlwaysShow);
|
|
52
|
+
static const auto fieldNeedBle = clazz->getField<jni::JBoolean>("needBle");
|
|
53
|
+
jni::local_ref<jni::JBoolean> needBle = this->getFieldValue(fieldNeedBle);
|
|
54
|
+
return LocationSettingsOptions(
|
|
51
55
|
enableHighAccuracy != nullptr ? std::make_optional(static_cast<bool>(enableHighAccuracy->value())) : std::nullopt,
|
|
56
|
+
accuracy != nullptr ? std::make_optional(accuracy->toCpp()) : std::nullopt,
|
|
52
57
|
interval != nullptr ? std::make_optional(interval->value()) : std::nullopt,
|
|
53
58
|
fastestInterval != nullptr ? std::make_optional(fastestInterval->value()) : std::nullopt,
|
|
54
59
|
distanceFilter != nullptr ? std::make_optional(distanceFilter->value()) : std::nullopt,
|
|
55
|
-
|
|
60
|
+
alwaysShow != nullptr ? std::make_optional(static_cast<bool>(alwaysShow->value())) : std::nullopt,
|
|
61
|
+
needBle != nullptr ? std::make_optional(static_cast<bool>(needBle->value())) : std::nullopt
|
|
56
62
|
);
|
|
57
63
|
}
|
|
58
64
|
|
|
@@ -61,19 +67,19 @@ namespace margelo::nitro::nitrogeolocation {
|
|
|
61
67
|
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
62
68
|
*/
|
|
63
69
|
[[maybe_unused]]
|
|
64
|
-
static jni::local_ref<
|
|
65
|
-
using JSignature =
|
|
70
|
+
static jni::local_ref<JLocationSettingsOptions::javaobject> fromCpp(const LocationSettingsOptions& value) {
|
|
71
|
+
using JSignature = JLocationSettingsOptions(jni::alias_ref<jni::JBoolean>, jni::alias_ref<JLocationAccuracyOptions>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JDouble>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<jni::JBoolean>);
|
|
66
72
|
static const auto clazz = javaClassStatic();
|
|
67
73
|
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
68
74
|
return create(
|
|
69
75
|
clazz,
|
|
70
|
-
value.timeout.has_value() ? jni::JDouble::valueOf(value.timeout.value()) : nullptr,
|
|
71
|
-
value.maximumAge.has_value() ? jni::JDouble::valueOf(value.maximumAge.value()) : nullptr,
|
|
72
76
|
value.enableHighAccuracy.has_value() ? jni::JBoolean::valueOf(value.enableHighAccuracy.value()) : nullptr,
|
|
77
|
+
value.accuracy.has_value() ? JLocationAccuracyOptions::fromCpp(value.accuracy.value()) : nullptr,
|
|
73
78
|
value.interval.has_value() ? jni::JDouble::valueOf(value.interval.value()) : nullptr,
|
|
74
79
|
value.fastestInterval.has_value() ? jni::JDouble::valueOf(value.fastestInterval.value()) : nullptr,
|
|
75
80
|
value.distanceFilter.has_value() ? jni::JDouble::valueOf(value.distanceFilter.value()) : nullptr,
|
|
76
|
-
value.
|
|
81
|
+
value.alwaysShow.has_value() ? jni::JBoolean::valueOf(value.alwaysShow.value()) : nullptr,
|
|
82
|
+
value.needBle.has_value() ? jni::JBoolean::valueOf(value.needBle.value()) : nullptr
|
|
77
83
|
);
|
|
78
84
|
}
|
|
79
85
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JReverseGeocodedAddress.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "ReverseGeocodedAddress.hpp"
|
|
12
|
+
|
|
13
|
+
#include <optional>
|
|
14
|
+
#include <string>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The C++ JNI bridge between the C++ struct "ReverseGeocodedAddress" and the the Kotlin data class "ReverseGeocodedAddress".
|
|
22
|
+
*/
|
|
23
|
+
struct JReverseGeocodedAddress final: public jni::JavaClass<JReverseGeocodedAddress> {
|
|
24
|
+
public:
|
|
25
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/ReverseGeocodedAddress;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct ReverseGeocodedAddress by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
ReverseGeocodedAddress toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldCountry = clazz->getField<jni::JString>("country");
|
|
36
|
+
jni::local_ref<jni::JString> country = this->getFieldValue(fieldCountry);
|
|
37
|
+
static const auto fieldRegion = clazz->getField<jni::JString>("region");
|
|
38
|
+
jni::local_ref<jni::JString> region = this->getFieldValue(fieldRegion);
|
|
39
|
+
static const auto fieldCity = clazz->getField<jni::JString>("city");
|
|
40
|
+
jni::local_ref<jni::JString> city = this->getFieldValue(fieldCity);
|
|
41
|
+
static const auto fieldDistrict = clazz->getField<jni::JString>("district");
|
|
42
|
+
jni::local_ref<jni::JString> district = this->getFieldValue(fieldDistrict);
|
|
43
|
+
static const auto fieldStreet = clazz->getField<jni::JString>("street");
|
|
44
|
+
jni::local_ref<jni::JString> street = this->getFieldValue(fieldStreet);
|
|
45
|
+
static const auto fieldPostalCode = clazz->getField<jni::JString>("postalCode");
|
|
46
|
+
jni::local_ref<jni::JString> postalCode = this->getFieldValue(fieldPostalCode);
|
|
47
|
+
static const auto fieldFormattedAddress = clazz->getField<jni::JString>("formattedAddress");
|
|
48
|
+
jni::local_ref<jni::JString> formattedAddress = this->getFieldValue(fieldFormattedAddress);
|
|
49
|
+
return ReverseGeocodedAddress(
|
|
50
|
+
country != nullptr ? std::make_optional(country->toStdString()) : std::nullopt,
|
|
51
|
+
region != nullptr ? std::make_optional(region->toStdString()) : std::nullopt,
|
|
52
|
+
city != nullptr ? std::make_optional(city->toStdString()) : std::nullopt,
|
|
53
|
+
district != nullptr ? std::make_optional(district->toStdString()) : std::nullopt,
|
|
54
|
+
street != nullptr ? std::make_optional(street->toStdString()) : std::nullopt,
|
|
55
|
+
postalCode != nullptr ? std::make_optional(postalCode->toStdString()) : std::nullopt,
|
|
56
|
+
formattedAddress != nullptr ? std::make_optional(formattedAddress->toStdString()) : std::nullopt
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public:
|
|
61
|
+
/**
|
|
62
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
63
|
+
*/
|
|
64
|
+
[[maybe_unused]]
|
|
65
|
+
static jni::local_ref<JReverseGeocodedAddress::javaobject> fromCpp(const ReverseGeocodedAddress& value) {
|
|
66
|
+
using JSignature = JReverseGeocodedAddress(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>);
|
|
67
|
+
static const auto clazz = javaClassStatic();
|
|
68
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
69
|
+
return create(
|
|
70
|
+
clazz,
|
|
71
|
+
value.country.has_value() ? jni::make_jstring(value.country.value()) : nullptr,
|
|
72
|
+
value.region.has_value() ? jni::make_jstring(value.region.value()) : nullptr,
|
|
73
|
+
value.city.has_value() ? jni::make_jstring(value.city.value()) : nullptr,
|
|
74
|
+
value.district.has_value() ? jni::make_jstring(value.district.value()) : nullptr,
|
|
75
|
+
value.street.has_value() ? jni::make_jstring(value.street.value()) : nullptr,
|
|
76
|
+
value.postalCode.has_value() ? jni::make_jstring(value.postalCode.value()) : nullptr,
|
|
77
|
+
value.formattedAddress.has_value() ? jni::make_jstring(value.formattedAddress.value()) : nullptr
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AccuracyAuthorization.kt
|
|
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
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "AccuracyAuthorization".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class AccuracyAuthorization(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
REDUCED(0),
|
|
20
|
+
FULL(1),
|
|
21
|
+
UNKNOWN(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AndroidAccuracyPreset.kt
|
|
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
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "AndroidAccuracyPreset".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class AndroidAccuracyPreset(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
HIGH(0),
|
|
20
|
+
BALANCED(1),
|
|
21
|
+
LOW(2),
|
|
22
|
+
PASSIVE(3);
|
|
23
|
+
|
|
24
|
+
companion object
|
|
25
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AndroidGranularity.kt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// AndroidGranularity.kt
|
|
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
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "AndroidGranularity".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class AndroidGranularity(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
PERMISSION(0),
|
|
20
|
+
COARSE(1),
|
|
21
|
+
FINE(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// CompatGeolocationConfigurationInternal.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -12,11 +12,11 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Represents the JavaScript object/struct "
|
|
15
|
+
* Represents the JavaScript object/struct "CompatGeolocationConfigurationInternal".
|
|
16
16
|
*/
|
|
17
17
|
@DoNotStrip
|
|
18
18
|
@Keep
|
|
19
|
-
data class
|
|
19
|
+
data class CompatGeolocationConfigurationInternal(
|
|
20
20
|
@DoNotStrip
|
|
21
21
|
@Keep
|
|
22
22
|
val skipPermissionRequests: Boolean,
|
|
@@ -40,8 +40,8 @@ data class RNConfigurationInternal(
|
|
|
40
40
|
@Keep
|
|
41
41
|
@Suppress("unused")
|
|
42
42
|
@JvmStatic
|
|
43
|
-
private fun fromCpp(skipPermissionRequests: Boolean, authorizationLevel: AuthorizationLevelInternal?, enableBackgroundLocationUpdates: Boolean?, locationProvider: LocationProviderInternal?):
|
|
44
|
-
return
|
|
43
|
+
private fun fromCpp(skipPermissionRequests: Boolean, authorizationLevel: AuthorizationLevelInternal?, enableBackgroundLocationUpdates: Boolean?, locationProvider: LocationProviderInternal?): CompatGeolocationConfigurationInternal {
|
|
44
|
+
return CompatGeolocationConfigurationInternal(skipPermissionRequests, authorizationLevel, enableBackgroundLocationUpdates, locationProvider)
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///
|
|
2
|
-
///
|
|
2
|
+
/// CompatGeolocationError.kt
|
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
4
|
/// https://github.com/mrousavy/nitro
|
|
5
5
|
/// Copyright © Marc Rousavy @ Margelo
|
|
@@ -12,11 +12,11 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Represents the JavaScript object/struct "
|
|
15
|
+
* Represents the JavaScript object/struct "CompatGeolocationError".
|
|
16
16
|
*/
|
|
17
17
|
@DoNotStrip
|
|
18
18
|
@Keep
|
|
19
|
-
data class
|
|
19
|
+
data class CompatGeolocationError(
|
|
20
20
|
@DoNotStrip
|
|
21
21
|
@Keep
|
|
22
22
|
val code: Double,
|
|
@@ -43,8 +43,8 @@ data class GeolocationError(
|
|
|
43
43
|
@Keep
|
|
44
44
|
@Suppress("unused")
|
|
45
45
|
@JvmStatic
|
|
46
|
-
private fun fromCpp(code: Double, message: String, PERMISSION_DENIED: Double, POSITION_UNAVAILABLE: Double, TIMEOUT: Double):
|
|
47
|
-
return
|
|
46
|
+
private fun fromCpp(code: Double, message: String, PERMISSION_DENIED: Double, POSITION_UNAVAILABLE: Double, TIMEOUT: Double): CompatGeolocationError {
|
|
47
|
+
return CompatGeolocationError(code, message, PERMISSION_DENIED, POSITION_UNAVAILABLE, TIMEOUT)
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CompatGeolocationOptions.kt
|
|
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
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "CompatGeolocationOptions".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class CompatGeolocationOptions(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val timeout: Double?,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val maximumAge: Double?,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val enableHighAccuracy: Boolean?,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val accuracy: LocationAccuracyOptions?,
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
val interval: Double?,
|
|
35
|
+
@DoNotStrip
|
|
36
|
+
@Keep
|
|
37
|
+
val fastestInterval: Double?,
|
|
38
|
+
@DoNotStrip
|
|
39
|
+
@Keep
|
|
40
|
+
val distanceFilter: Double?,
|
|
41
|
+
@DoNotStrip
|
|
42
|
+
@Keep
|
|
43
|
+
val useSignificantChanges: Boolean?,
|
|
44
|
+
@DoNotStrip
|
|
45
|
+
@Keep
|
|
46
|
+
val activityType: IOSActivityType?,
|
|
47
|
+
@DoNotStrip
|
|
48
|
+
@Keep
|
|
49
|
+
val pausesLocationUpdatesAutomatically: Boolean?,
|
|
50
|
+
@DoNotStrip
|
|
51
|
+
@Keep
|
|
52
|
+
val showsBackgroundLocationIndicator: Boolean?
|
|
53
|
+
) {
|
|
54
|
+
/* primary constructor */
|
|
55
|
+
|
|
56
|
+
companion object {
|
|
57
|
+
/**
|
|
58
|
+
* Constructor called from C++
|
|
59
|
+
*/
|
|
60
|
+
@DoNotStrip
|
|
61
|
+
@Keep
|
|
62
|
+
@Suppress("unused")
|
|
63
|
+
@JvmStatic
|
|
64
|
+
private fun fromCpp(timeout: Double?, maximumAge: Double?, enableHighAccuracy: Boolean?, accuracy: LocationAccuracyOptions?, interval: Double?, fastestInterval: Double?, distanceFilter: Double?, useSignificantChanges: Boolean?, activityType: IOSActivityType?, pausesLocationUpdatesAutomatically: Boolean?, showsBackgroundLocationIndicator: Boolean?): CompatGeolocationOptions {
|
|
65
|
+
return CompatGeolocationOptions(timeout, maximumAge, enableHighAccuracy, accuracy, interval, fastestInterval, distanceFilter, useSignificantChanges, activityType, pausesLocationUpdatesAutomatically, showsBackgroundLocationIndicator)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CompatGeolocationResponse.kt
|
|
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
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "CompatGeolocationResponse".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class CompatGeolocationResponse(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val coords: GeolocationCoordinates,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val timestamp: Double
|
|
26
|
+
) {
|
|
27
|
+
/* primary constructor */
|
|
28
|
+
|
|
29
|
+
companion object {
|
|
30
|
+
/**
|
|
31
|
+
* Constructor called from C++
|
|
32
|
+
*/
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
@Suppress("unused")
|
|
36
|
+
@JvmStatic
|
|
37
|
+
private fun fromCpp(coords: GeolocationCoordinates, timestamp: Double): CompatGeolocationResponse {
|
|
38
|
+
return CompatGeolocationResponse(coords, timestamp)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|