react-native-nitro-geolocation 1.2.6 → 1.3.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 +52 -295
- package/android/build.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +39 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidFusedLocationProvider.kt +310 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidFusedRequestFactory.kt +31 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidGeolocationConversions.kt +71 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidGeolocationErrors.kt +85 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidGeolocationOptions.kt +92 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidLocationSettings.kt +3 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/AndroidProviderRoute.kt +74 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroBackgroundLocation.kt +132 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/NitroGeolocation.kt +219 -476
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/AndroidBackgroundHttpSync.kt +134 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/AndroidBackgroundPermissions.kt +196 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/AndroidBackgroundSerialization.kt +266 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroActivityRecognitionReceiver.kt +13 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroBackgroundEventHub.kt +65 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroBackgroundHeadlessTaskService.kt +58 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroBackgroundLocationController.kt +710 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroBackgroundLocationService.kt +48 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroBackgroundNotificationFactory.kt +37 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroBackgroundStore.kt +655 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroBootReceiver.kt +26 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroGeofenceReceiver.kt +14 -0
- package/android/src/main/java/com/margelo/nitro/nitrogeolocation/background/NitroLocationUpdateReceiver.kt +37 -0
- package/android/src/test/java/com/margelo/nitro/nitrogeolocation/AndroidFusedLocationProviderTest.kt +64 -0
- package/android/src/test/java/com/margelo/nitro/nitrogeolocation/AndroidProviderRouteTest.kt +116 -0
- package/ios/IOSBackgroundHttpSync.swift +126 -0
- package/ios/IOSBackgroundLocationDelegate.swift +36 -0
- package/ios/IOSBackgroundMotion.swift +55 -0
- package/ios/IOSBackgroundSerialization.swift +539 -0
- package/ios/IOSGeolocationConversions.swift +131 -0
- package/ios/IOSGeolocationDelegate.swift +31 -0
- package/ios/IOSGeolocationErrors.swift +39 -0
- package/ios/IOSGeolocationOptions.swift +135 -0
- package/ios/NitroBackgroundLocation.swift +849 -0
- package/ios/NitroGeolocation.swift +14 -347
- package/nitrogen/generated/android/c++/JActivityRecognitionOptions.hpp +69 -0
- package/nitrogen/generated/android/c++/JAndroidBackgroundLocationOptions.hpp +74 -0
- package/nitrogen/generated/android/c++/JAndroidBackgroundLocationStatus.hpp +67 -0
- package/nitrogen/generated/android/c++/JAndroidBackgroundProvider.hpp +61 -0
- package/nitrogen/generated/android/c++/JAndroidForegroundServiceOptions.hpp +90 -0
- package/nitrogen/generated/android/c++/JBackgroundEventEnvelope.hpp +129 -0
- package/nitrogen/generated/android/c++/JBackgroundEventType.hpp +70 -0
- package/nitrogen/generated/android/c++/JBackgroundHttpMethod.hpp +61 -0
- package/nitrogen/generated/android/c++/JBackgroundHttpSyncOptions.hpp +131 -0
- package/nitrogen/generated/android/c++/JBackgroundHttpSyncResult.hpp +111 -0
- package/nitrogen/generated/android/c++/JBackgroundLocation.hpp +110 -0
- package/nitrogen/generated/android/c++/JBackgroundLocationOptions.hpp +162 -0
- package/nitrogen/generated/android/c++/JBackgroundLocationSource.hpp +73 -0
- package/nitrogen/generated/android/c++/JBackgroundLocationState.hpp +70 -0
- package/nitrogen/generated/android/c++/JBackgroundLocationStatus.hpp +126 -0
- package/nitrogen/generated/android/c++/JBackgroundPermissionResult.hpp +79 -0
- package/nitrogen/generated/android/c++/JBackgroundPermissionStatus.hpp +64 -0
- package/nitrogen/generated/android/c++/JBackgroundTrackingMode.hpp +61 -0
- package/nitrogen/generated/android/c++/JBatterySnapshot.hpp +61 -0
- package/nitrogen/generated/android/c++/JDetectedActivity.hpp +66 -0
- package/nitrogen/generated/android/c++/JDetectedActivityType.hpp +76 -0
- package/nitrogen/generated/android/c++/JFunc_void_BackgroundEventEnvelope.hpp +114 -0
- package/nitrogen/generated/android/c++/JFunc_void_BackgroundLocation.hpp +95 -0
- package/nitrogen/generated/android/c++/JGeofenceEvent.hpp +94 -0
- package/nitrogen/generated/android/c++/JGeofenceRegion.hpp +112 -0
- package/nitrogen/generated/android/c++/JGeofenceTransition.hpp +61 -0
- package/nitrogen/generated/android/c++/JGeofencingOptions.hpp +82 -0
- package/nitrogen/generated/android/c++/JGetStoredBackgroundEventsOptions.hpp +90 -0
- package/nitrogen/generated/android/c++/JGetStoredBackgroundLocationsOptions.hpp +69 -0
- package/nitrogen/generated/android/c++/JHybridNitroBackgroundLocationSpec.cpp +662 -0
- package/nitrogen/generated/android/c++/JHybridNitroBackgroundLocationSpec.hpp +89 -0
- package/nitrogen/generated/android/c++/JIOSBackgroundActivityType.hpp +67 -0
- package/nitrogen/generated/android/c++/JIOSBackgroundLocationOptions.hpp +79 -0
- package/nitrogen/generated/android/c++/JIOSBackgroundLocationStatus.hpp +61 -0
- package/nitrogen/generated/android/c++/JLocationProviderStatus.hpp +5 -1
- package/nitrogen/generated/android/c++/JStoredBackgroundEventEnvelope.hpp +115 -0
- package/nitrogen/generated/android/c++/JStoredBackgroundLocation.hpp +122 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Boolean_String_Double.cpp +34 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Boolean_String_Double.hpp +100 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/ActivityRecognitionOptions.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AndroidBackgroundLocationOptions.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AndroidBackgroundLocationStatus.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AndroidBackgroundProvider.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/AndroidForegroundServiceOptions.kt +91 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundEventEnvelope.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundEventType.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundHttpMethod.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundHttpSyncOptions.kt +101 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundHttpSyncResult.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundLocation.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundLocationOptions.kt +136 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundLocationSource.kt +28 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundLocationState.kt +27 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundLocationStatus.kt +116 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundPermissionResult.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundPermissionStatus.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BackgroundTrackingMode.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/BatterySnapshot.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/DetectedActivity.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/DetectedActivityType.kt +29 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_BackgroundEventEnvelope.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Func_void_BackgroundLocation.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeofenceEvent.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeofenceRegion.kt +96 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeofenceTransition.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GeofencingOptions.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GetStoredBackgroundEventsOptions.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/GetStoredBackgroundLocationsOptions.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/HybridNitroBackgroundLocationSpec.kt +174 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/IOSBackgroundActivityType.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/IOSBackgroundLocationOptions.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/IOSBackgroundLocationStatus.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/LocationProviderStatus.kt +7 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/StoredBackgroundEventEnvelope.kt +76 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/StoredBackgroundLocation.kt +111 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrogeolocation/Variant_NullType_Boolean_String_Double.kt +88 -0
- package/nitrogen/generated/android/nitrogeolocation+autolinking.cmake +3 -0
- package/nitrogen/generated/android/nitrogeolocationOnLoad.cpp +20 -0
- package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.cpp +104 -15
- package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Bridge.hpp +1107 -50
- package/nitrogen/generated/ios/NitroGeolocation-Swift-Cxx-Umbrella.hpp +102 -0
- package/nitrogen/generated/ios/NitroGeolocationAutolinking.mm +8 -0
- package/nitrogen/generated/ios/NitroGeolocationAutolinking.swift +15 -3
- package/nitrogen/generated/ios/c++/HybridNitroBackgroundLocationSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroBackgroundLocationSpecSwift.hpp +416 -0
- package/nitrogen/generated/ios/swift/ActivityRecognitionOptions.swift +96 -0
- package/nitrogen/generated/ios/swift/AndroidBackgroundLocationOptions.swift +76 -0
- package/nitrogen/generated/ios/swift/AndroidBackgroundLocationStatus.swift +58 -0
- package/nitrogen/generated/ios/swift/AndroidBackgroundProvider.swift +44 -0
- package/nitrogen/generated/ios/swift/AndroidForegroundServiceOptions.swift +160 -0
- package/nitrogen/generated/ios/swift/BackgroundEventEnvelope.swift +110 -0
- package/nitrogen/generated/ios/swift/BackgroundEventType.swift +56 -0
- package/nitrogen/generated/ios/swift/BackgroundHttpMethod.swift +44 -0
- package/nitrogen/generated/ios/swift/BackgroundHttpSyncOptions.swift +259 -0
- package/nitrogen/generated/ios/swift/BackgroundHttpSyncResult.swift +87 -0
- package/nitrogen/generated/ios/swift/BackgroundLocation.swift +118 -0
- package/nitrogen/generated/ios/swift/BackgroundLocationOptions.swift +292 -0
- package/nitrogen/generated/ios/swift/BackgroundLocationSource.swift +60 -0
- package/nitrogen/generated/ios/swift/BackgroundLocationState.swift +56 -0
- package/nitrogen/generated/ios/swift/BackgroundLocationStatus.swift +124 -0
- package/nitrogen/generated/ios/swift/BackgroundPermissionResult.swift +81 -0
- package/nitrogen/generated/ios/swift/BackgroundPermissionStatus.swift +48 -0
- package/nitrogen/generated/ios/swift/BackgroundTrackingMode.swift +44 -0
- package/nitrogen/generated/ios/swift/BatterySnapshot.swift +60 -0
- package/nitrogen/generated/ios/swift/DetectedActivity.swift +39 -0
- package/nitrogen/generated/ios/swift/DetectedActivityType.swift +64 -0
- package/nitrogen/generated/ios/swift/Func_void_BackgroundEventEnvelope.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_BackgroundHttpSyncResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_BackgroundLocation.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_BackgroundLocationStatus.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_BackgroundPermissionResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__optional_BackgroundLocationOptions_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_GeofenceRegion_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_StoredBackgroundEventEnvelope_.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_StoredBackgroundLocation_.swift +46 -0
- package/nitrogen/generated/ios/swift/GeofenceEvent.swift +50 -0
- package/nitrogen/generated/ios/swift/GeofenceRegion.swift +195 -0
- package/nitrogen/generated/ios/swift/GeofenceTransition.swift +44 -0
- package/nitrogen/generated/ios/swift/GeofencingOptions.swift +66 -0
- package/nitrogen/generated/ios/swift/GetStoredBackgroundEventsOptions.swift +102 -0
- package/nitrogen/generated/ios/swift/GetStoredBackgroundLocationsOptions.swift +96 -0
- package/nitrogen/generated/ios/swift/HybridNitroBackgroundLocationSpec.swift +81 -0
- package/nitrogen/generated/ios/swift/HybridNitroBackgroundLocationSpec_cxx.swift +654 -0
- package/nitrogen/generated/ios/swift/IOSBackgroundActivityType.swift +52 -0
- package/nitrogen/generated/ios/swift/IOSBackgroundLocationOptions.swift +125 -0
- package/nitrogen/generated/ios/swift/IOSBackgroundLocationStatus.swift +34 -0
- package/nitrogen/generated/ios/swift/LocationProviderStatus.swift +19 -1
- package/nitrogen/generated/ios/swift/StoredBackgroundEventEnvelope.swift +54 -0
- package/nitrogen/generated/ios/swift/StoredBackgroundLocation.swift +120 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_Bool_String_Double.swift +34 -0
- package/nitrogen/generated/shared/c++/ActivityRecognitionOptions.hpp +95 -0
- package/nitrogen/generated/shared/c++/AndroidBackgroundLocationOptions.hpp +100 -0
- package/nitrogen/generated/shared/c++/AndroidBackgroundLocationStatus.hpp +93 -0
- package/nitrogen/generated/shared/c++/AndroidBackgroundProvider.hpp +80 -0
- package/nitrogen/generated/shared/c++/AndroidForegroundServiceOptions.hpp +116 -0
- package/nitrogen/generated/shared/c++/BackgroundEventEnvelope.hpp +140 -0
- package/nitrogen/generated/shared/c++/BackgroundEventType.hpp +92 -0
- package/nitrogen/generated/shared/c++/BackgroundHttpMethod.hpp +80 -0
- package/nitrogen/generated/shared/c++/BackgroundHttpSyncOptions.hpp +129 -0
- package/nitrogen/generated/shared/c++/BackgroundHttpSyncResult.hpp +101 -0
- package/nitrogen/generated/shared/c++/BackgroundLocation.hpp +134 -0
- package/nitrogen/generated/shared/c++/BackgroundLocationOptions.hpp +174 -0
- package/nitrogen/generated/shared/c++/BackgroundLocationSource.hpp +96 -0
- package/nitrogen/generated/shared/c++/BackgroundLocationState.hpp +92 -0
- package/nitrogen/generated/shared/c++/BackgroundLocationStatus.hpp +158 -0
- package/nitrogen/generated/shared/c++/BackgroundPermissionResult.hpp +107 -0
- package/nitrogen/generated/shared/c++/BackgroundPermissionStatus.hpp +84 -0
- package/nitrogen/generated/shared/c++/BackgroundTrackingMode.hpp +80 -0
- package/nitrogen/generated/shared/c++/BatterySnapshot.hpp +87 -0
- package/nitrogen/generated/shared/c++/DetectedActivity.hpp +92 -0
- package/nitrogen/generated/shared/c++/DetectedActivityType.hpp +100 -0
- package/nitrogen/generated/shared/c++/GeofenceEvent.hpp +103 -0
- package/nitrogen/generated/shared/c++/GeofenceRegion.hpp +123 -0
- package/nitrogen/generated/shared/c++/GeofenceTransition.hpp +80 -0
- package/nitrogen/generated/shared/c++/GeofencingOptions.hpp +90 -0
- package/nitrogen/generated/shared/c++/GetStoredBackgroundEventsOptions.hpp +98 -0
- package/nitrogen/generated/shared/c++/GetStoredBackgroundLocationsOptions.hpp +95 -0
- package/nitrogen/generated/shared/c++/HybridNitroBackgroundLocationSpec.cpp +47 -0
- package/nitrogen/generated/shared/c++/HybridNitroBackgroundLocationSpec.hpp +133 -0
- package/nitrogen/generated/shared/c++/IOSBackgroundActivityType.hpp +88 -0
- package/nitrogen/generated/shared/c++/IOSBackgroundLocationOptions.hpp +105 -0
- package/nitrogen/generated/shared/c++/IOSBackgroundLocationStatus.hpp +87 -0
- package/nitrogen/generated/shared/c++/LocationProviderStatus.hpp +5 -1
- package/nitrogen/generated/shared/c++/StoredBackgroundEventEnvelope.hpp +108 -0
- package/nitrogen/generated/shared/c++/StoredBackgroundLocation.hpp +146 -0
- package/package.json +17 -6
- package/src/NitroGeolocation.nitro.ts +4 -4
- package/src/api/getCurrentPosition.ts +1 -1
- package/src/api/requestLocationSettings.ts +3 -2
- package/src/background/NitroBackgroundLocation.nitro.ts +83 -0
- package/src/background/index.ts +200 -0
- package/src/background/index.web.ts +120 -0
- package/src/background/task.ts +13 -0
- package/src/background/types.ts +328 -0
- package/src/compat/index.web.ts +141 -0
- package/src/index.tsx +3 -0
- package/src/index.web.tsx +41 -0
- package/src/publicTypes.ts +6 -5
- package/src/types.ts +3 -0
- package/src/web/browser.ts +171 -0
- package/src/web/index.ts +167 -0
- package/src/web/useWatchPosition.ts +76 -0
- package/src/web/watch.ts +81 -0
- package/src/devtools/index.test.ts +0 -54
- package/src/utils/errors.test.ts +0 -65
- package/src/utils/provider.test.ts +0 -303
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JAndroidBackgroundLocationStatus.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 "AndroidBackgroundLocationStatus.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JPermissionStatus.hpp"
|
|
14
|
+
#include "PermissionStatus.hpp"
|
|
15
|
+
#include <optional>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The C++ JNI bridge between the C++ struct "AndroidBackgroundLocationStatus" and the the Kotlin data class "AndroidBackgroundLocationStatus".
|
|
23
|
+
*/
|
|
24
|
+
struct JAndroidBackgroundLocationStatus final: public jni::JavaClass<JAndroidBackgroundLocationStatus> {
|
|
25
|
+
public:
|
|
26
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/AndroidBackgroundLocationStatus;";
|
|
27
|
+
|
|
28
|
+
public:
|
|
29
|
+
/**
|
|
30
|
+
* Convert this Java/Kotlin-based struct to the C++ struct AndroidBackgroundLocationStatus by copying all values to C++.
|
|
31
|
+
*/
|
|
32
|
+
[[maybe_unused]]
|
|
33
|
+
[[nodiscard]]
|
|
34
|
+
AndroidBackgroundLocationStatus toCpp() const {
|
|
35
|
+
static const auto clazz = javaClassStatic();
|
|
36
|
+
static const auto fieldIsForegroundServiceRunning = clazz->getField<jboolean>("isForegroundServiceRunning");
|
|
37
|
+
jboolean isForegroundServiceRunning = this->getFieldValue(fieldIsForegroundServiceRunning);
|
|
38
|
+
static const auto fieldIsIgnoringBatteryOptimizations = clazz->getField<jni::JBoolean>("isIgnoringBatteryOptimizations");
|
|
39
|
+
jni::local_ref<jni::JBoolean> isIgnoringBatteryOptimizations = this->getFieldValue(fieldIsIgnoringBatteryOptimizations);
|
|
40
|
+
static const auto fieldNotificationPermission = clazz->getField<JPermissionStatus>("notificationPermission");
|
|
41
|
+
jni::local_ref<JPermissionStatus> notificationPermission = this->getFieldValue(fieldNotificationPermission);
|
|
42
|
+
return AndroidBackgroundLocationStatus(
|
|
43
|
+
static_cast<bool>(isForegroundServiceRunning),
|
|
44
|
+
isIgnoringBatteryOptimizations != nullptr ? std::make_optional(static_cast<bool>(isIgnoringBatteryOptimizations->value())) : std::nullopt,
|
|
45
|
+
notificationPermission != nullptr ? std::make_optional(notificationPermission->toCpp()) : std::nullopt
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
52
|
+
*/
|
|
53
|
+
[[maybe_unused]]
|
|
54
|
+
static jni::local_ref<JAndroidBackgroundLocationStatus::javaobject> fromCpp(const AndroidBackgroundLocationStatus& value) {
|
|
55
|
+
using JSignature = JAndroidBackgroundLocationStatus(jboolean, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JPermissionStatus>);
|
|
56
|
+
static const auto clazz = javaClassStatic();
|
|
57
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
58
|
+
return create(
|
|
59
|
+
clazz,
|
|
60
|
+
value.isForegroundServiceRunning,
|
|
61
|
+
value.isIgnoringBatteryOptimizations.has_value() ? jni::JBoolean::valueOf(value.isIgnoringBatteryOptimizations.value()) : nullptr,
|
|
62
|
+
value.notificationPermission.has_value() ? JPermissionStatus::fromCpp(value.notificationPermission.value()) : nullptr
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JAndroidBackgroundProvider.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 "AndroidBackgroundProvider.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "AndroidBackgroundProvider" and the the Kotlin enum "AndroidBackgroundProvider".
|
|
19
|
+
*/
|
|
20
|
+
struct JAndroidBackgroundProvider final: public jni::JavaClass<JAndroidBackgroundProvider> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/AndroidBackgroundProvider;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum AndroidBackgroundProvider.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
AndroidBackgroundProvider 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<AndroidBackgroundProvider>(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<JAndroidBackgroundProvider> fromCpp(AndroidBackgroundProvider value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case AndroidBackgroundProvider::AUTO:
|
|
46
|
+
static const auto fieldAUTO = clazz->getStaticField<JAndroidBackgroundProvider>("AUTO");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldAUTO);
|
|
48
|
+
case AndroidBackgroundProvider::PLAYSERVICES:
|
|
49
|
+
static const auto fieldPLAYSERVICES = clazz->getStaticField<JAndroidBackgroundProvider>("PLAYSERVICES");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldPLAYSERVICES);
|
|
51
|
+
case AndroidBackgroundProvider::ANDROID_PLATFORM:
|
|
52
|
+
static const auto fieldANDROID_PLATFORM = clazz->getStaticField<JAndroidBackgroundProvider>("ANDROID_PLATFORM");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldANDROID_PLATFORM);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JAndroidForegroundServiceOptions.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 "AndroidForegroundServiceOptions.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 "AndroidForegroundServiceOptions" and the the Kotlin data class "AndroidForegroundServiceOptions".
|
|
22
|
+
*/
|
|
23
|
+
struct JAndroidForegroundServiceOptions final: public jni::JavaClass<JAndroidForegroundServiceOptions> {
|
|
24
|
+
public:
|
|
25
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/AndroidForegroundServiceOptions;";
|
|
26
|
+
|
|
27
|
+
public:
|
|
28
|
+
/**
|
|
29
|
+
* Convert this Java/Kotlin-based struct to the C++ struct AndroidForegroundServiceOptions by copying all values to C++.
|
|
30
|
+
*/
|
|
31
|
+
[[maybe_unused]]
|
|
32
|
+
[[nodiscard]]
|
|
33
|
+
AndroidForegroundServiceOptions toCpp() const {
|
|
34
|
+
static const auto clazz = javaClassStatic();
|
|
35
|
+
static const auto fieldNotificationId = clazz->getField<jni::JDouble>("notificationId");
|
|
36
|
+
jni::local_ref<jni::JDouble> notificationId = this->getFieldValue(fieldNotificationId);
|
|
37
|
+
static const auto fieldNotificationTitle = clazz->getField<jni::JString>("notificationTitle");
|
|
38
|
+
jni::local_ref<jni::JString> notificationTitle = this->getFieldValue(fieldNotificationTitle);
|
|
39
|
+
static const auto fieldNotificationText = clazz->getField<jni::JString>("notificationText");
|
|
40
|
+
jni::local_ref<jni::JString> notificationText = this->getFieldValue(fieldNotificationText);
|
|
41
|
+
static const auto fieldNotificationChannelId = clazz->getField<jni::JString>("notificationChannelId");
|
|
42
|
+
jni::local_ref<jni::JString> notificationChannelId = this->getFieldValue(fieldNotificationChannelId);
|
|
43
|
+
static const auto fieldNotificationChannelName = clazz->getField<jni::JString>("notificationChannelName");
|
|
44
|
+
jni::local_ref<jni::JString> notificationChannelName = this->getFieldValue(fieldNotificationChannelName);
|
|
45
|
+
static const auto fieldNotificationChannelDescription = clazz->getField<jni::JString>("notificationChannelDescription");
|
|
46
|
+
jni::local_ref<jni::JString> notificationChannelDescription = this->getFieldValue(fieldNotificationChannelDescription);
|
|
47
|
+
static const auto fieldNotificationIcon = clazz->getField<jni::JString>("notificationIcon");
|
|
48
|
+
jni::local_ref<jni::JString> notificationIcon = this->getFieldValue(fieldNotificationIcon);
|
|
49
|
+
static const auto fieldNotificationColor = clazz->getField<jni::JString>("notificationColor");
|
|
50
|
+
jni::local_ref<jni::JString> notificationColor = this->getFieldValue(fieldNotificationColor);
|
|
51
|
+
static const auto fieldStopActionTitle = clazz->getField<jni::JString>("stopActionTitle");
|
|
52
|
+
jni::local_ref<jni::JString> stopActionTitle = this->getFieldValue(fieldStopActionTitle);
|
|
53
|
+
return AndroidForegroundServiceOptions(
|
|
54
|
+
notificationId != nullptr ? std::make_optional(notificationId->value()) : std::nullopt,
|
|
55
|
+
notificationTitle->toStdString(),
|
|
56
|
+
notificationText->toStdString(),
|
|
57
|
+
notificationChannelId != nullptr ? std::make_optional(notificationChannelId->toStdString()) : std::nullopt,
|
|
58
|
+
notificationChannelName != nullptr ? std::make_optional(notificationChannelName->toStdString()) : std::nullopt,
|
|
59
|
+
notificationChannelDescription != nullptr ? std::make_optional(notificationChannelDescription->toStdString()) : std::nullopt,
|
|
60
|
+
notificationIcon != nullptr ? std::make_optional(notificationIcon->toStdString()) : std::nullopt,
|
|
61
|
+
notificationColor != nullptr ? std::make_optional(notificationColor->toStdString()) : std::nullopt,
|
|
62
|
+
stopActionTitle != nullptr ? std::make_optional(stopActionTitle->toStdString()) : std::nullopt
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public:
|
|
67
|
+
/**
|
|
68
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
69
|
+
*/
|
|
70
|
+
[[maybe_unused]]
|
|
71
|
+
static jni::local_ref<JAndroidForegroundServiceOptions::javaobject> fromCpp(const AndroidForegroundServiceOptions& value) {
|
|
72
|
+
using JSignature = JAndroidForegroundServiceOptions(jni::alias_ref<jni::JDouble>, 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>, jni::alias_ref<jni::JString>);
|
|
73
|
+
static const auto clazz = javaClassStatic();
|
|
74
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
75
|
+
return create(
|
|
76
|
+
clazz,
|
|
77
|
+
value.notificationId.has_value() ? jni::JDouble::valueOf(value.notificationId.value()) : nullptr,
|
|
78
|
+
jni::make_jstring(value.notificationTitle),
|
|
79
|
+
jni::make_jstring(value.notificationText),
|
|
80
|
+
value.notificationChannelId.has_value() ? jni::make_jstring(value.notificationChannelId.value()) : nullptr,
|
|
81
|
+
value.notificationChannelName.has_value() ? jni::make_jstring(value.notificationChannelName.value()) : nullptr,
|
|
82
|
+
value.notificationChannelDescription.has_value() ? jni::make_jstring(value.notificationChannelDescription.value()) : nullptr,
|
|
83
|
+
value.notificationIcon.has_value() ? jni::make_jstring(value.notificationIcon.value()) : nullptr,
|
|
84
|
+
value.notificationColor.has_value() ? jni::make_jstring(value.notificationColor.value()) : nullptr,
|
|
85
|
+
value.stopActionTitle.has_value() ? jni::make_jstring(value.stopActionTitle.value()) : nullptr
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JBackgroundEventEnvelope.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 "BackgroundEventEnvelope.hpp"
|
|
12
|
+
|
|
13
|
+
#include "BackgroundEventType.hpp"
|
|
14
|
+
#include "BackgroundHttpSyncResult.hpp"
|
|
15
|
+
#include "BackgroundLocation.hpp"
|
|
16
|
+
#include "BackgroundLocationSource.hpp"
|
|
17
|
+
#include "BatterySnapshot.hpp"
|
|
18
|
+
#include "DetectedActivity.hpp"
|
|
19
|
+
#include "DetectedActivityType.hpp"
|
|
20
|
+
#include "GeofenceEvent.hpp"
|
|
21
|
+
#include "GeofenceRegion.hpp"
|
|
22
|
+
#include "GeofenceTransition.hpp"
|
|
23
|
+
#include "GeolocationCoordinates.hpp"
|
|
24
|
+
#include "JBackgroundEventType.hpp"
|
|
25
|
+
#include "JBackgroundHttpSyncResult.hpp"
|
|
26
|
+
#include "JBackgroundLocation.hpp"
|
|
27
|
+
#include "JBackgroundLocationSource.hpp"
|
|
28
|
+
#include "JBatterySnapshot.hpp"
|
|
29
|
+
#include "JDetectedActivity.hpp"
|
|
30
|
+
#include "JDetectedActivityType.hpp"
|
|
31
|
+
#include "JGeofenceEvent.hpp"
|
|
32
|
+
#include "JGeofenceRegion.hpp"
|
|
33
|
+
#include "JGeofenceTransition.hpp"
|
|
34
|
+
#include "JGeolocationCoordinates.hpp"
|
|
35
|
+
#include "JLocationError.hpp"
|
|
36
|
+
#include "JLocationProviderStatus.hpp"
|
|
37
|
+
#include "JLocationProviderUsed.hpp"
|
|
38
|
+
#include "JNullableDouble.hpp"
|
|
39
|
+
#include "JVariant_NullType_Boolean_String_Double.hpp"
|
|
40
|
+
#include "LocationError.hpp"
|
|
41
|
+
#include "LocationProviderStatus.hpp"
|
|
42
|
+
#include "LocationProviderUsed.hpp"
|
|
43
|
+
#include <NitroModules/JNull.hpp>
|
|
44
|
+
#include <NitroModules/Null.hpp>
|
|
45
|
+
#include <optional>
|
|
46
|
+
#include <string>
|
|
47
|
+
#include <unordered_map>
|
|
48
|
+
#include <variant>
|
|
49
|
+
#include <vector>
|
|
50
|
+
|
|
51
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
52
|
+
|
|
53
|
+
using namespace facebook;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The C++ JNI bridge between the C++ struct "BackgroundEventEnvelope" and the the Kotlin data class "BackgroundEventEnvelope".
|
|
57
|
+
*/
|
|
58
|
+
struct JBackgroundEventEnvelope final: public jni::JavaClass<JBackgroundEventEnvelope> {
|
|
59
|
+
public:
|
|
60
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/BackgroundEventEnvelope;";
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
/**
|
|
64
|
+
* Convert this Java/Kotlin-based struct to the C++ struct BackgroundEventEnvelope by copying all values to C++.
|
|
65
|
+
*/
|
|
66
|
+
[[maybe_unused]]
|
|
67
|
+
[[nodiscard]]
|
|
68
|
+
BackgroundEventEnvelope toCpp() const {
|
|
69
|
+
static const auto clazz = javaClassStatic();
|
|
70
|
+
static const auto fieldLocation = clazz->getField<JBackgroundLocation>("location");
|
|
71
|
+
jni::local_ref<JBackgroundLocation> location = this->getFieldValue(fieldLocation);
|
|
72
|
+
static const auto fieldGeofence = clazz->getField<JGeofenceEvent>("geofence");
|
|
73
|
+
jni::local_ref<JGeofenceEvent> geofence = this->getFieldValue(fieldGeofence);
|
|
74
|
+
static const auto fieldActivity = clazz->getField<JDetectedActivity>("activity");
|
|
75
|
+
jni::local_ref<JDetectedActivity> activity = this->getFieldValue(fieldActivity);
|
|
76
|
+
static const auto fieldProviderStatus = clazz->getField<JLocationProviderStatus>("providerStatus");
|
|
77
|
+
jni::local_ref<JLocationProviderStatus> providerStatus = this->getFieldValue(fieldProviderStatus);
|
|
78
|
+
static const auto fieldResult = clazz->getField<JBackgroundHttpSyncResult>("result");
|
|
79
|
+
jni::local_ref<JBackgroundHttpSyncResult> result = this->getFieldValue(fieldResult);
|
|
80
|
+
static const auto fieldError = clazz->getField<JLocationError>("error");
|
|
81
|
+
jni::local_ref<JLocationError> error = this->getFieldValue(fieldError);
|
|
82
|
+
static const auto fieldId = clazz->getField<jni::JString>("id");
|
|
83
|
+
jni::local_ref<jni::JString> id = this->getFieldValue(fieldId);
|
|
84
|
+
static const auto fieldType = clazz->getField<JBackgroundEventType>("type");
|
|
85
|
+
jni::local_ref<JBackgroundEventType> type = this->getFieldValue(fieldType);
|
|
86
|
+
static const auto fieldTimestamp = clazz->getField<double>("timestamp");
|
|
87
|
+
double timestamp = this->getFieldValue(fieldTimestamp);
|
|
88
|
+
static const auto fieldDeliveredToJS = clazz->getField<jboolean>("deliveredToJS");
|
|
89
|
+
jboolean deliveredToJS = this->getFieldValue(fieldDeliveredToJS);
|
|
90
|
+
return BackgroundEventEnvelope(
|
|
91
|
+
location != nullptr ? std::make_optional(location->toCpp()) : std::nullopt,
|
|
92
|
+
geofence != nullptr ? std::make_optional(geofence->toCpp()) : std::nullopt,
|
|
93
|
+
activity != nullptr ? std::make_optional(activity->toCpp()) : std::nullopt,
|
|
94
|
+
providerStatus != nullptr ? std::make_optional(providerStatus->toCpp()) : std::nullopt,
|
|
95
|
+
result != nullptr ? std::make_optional(result->toCpp()) : std::nullopt,
|
|
96
|
+
error != nullptr ? std::make_optional(error->toCpp()) : std::nullopt,
|
|
97
|
+
id->toStdString(),
|
|
98
|
+
type->toCpp(),
|
|
99
|
+
timestamp,
|
|
100
|
+
static_cast<bool>(deliveredToJS)
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
public:
|
|
105
|
+
/**
|
|
106
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
107
|
+
*/
|
|
108
|
+
[[maybe_unused]]
|
|
109
|
+
static jni::local_ref<JBackgroundEventEnvelope::javaobject> fromCpp(const BackgroundEventEnvelope& value) {
|
|
110
|
+
using JSignature = JBackgroundEventEnvelope(jni::alias_ref<JBackgroundLocation>, jni::alias_ref<JGeofenceEvent>, jni::alias_ref<JDetectedActivity>, jni::alias_ref<JLocationProviderStatus>, jni::alias_ref<JBackgroundHttpSyncResult>, jni::alias_ref<JLocationError>, jni::alias_ref<jni::JString>, jni::alias_ref<JBackgroundEventType>, double, jboolean);
|
|
111
|
+
static const auto clazz = javaClassStatic();
|
|
112
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
113
|
+
return create(
|
|
114
|
+
clazz,
|
|
115
|
+
value.location.has_value() ? JBackgroundLocation::fromCpp(value.location.value()) : nullptr,
|
|
116
|
+
value.geofence.has_value() ? JGeofenceEvent::fromCpp(value.geofence.value()) : nullptr,
|
|
117
|
+
value.activity.has_value() ? JDetectedActivity::fromCpp(value.activity.value()) : nullptr,
|
|
118
|
+
value.providerStatus.has_value() ? JLocationProviderStatus::fromCpp(value.providerStatus.value()) : nullptr,
|
|
119
|
+
value.result.has_value() ? JBackgroundHttpSyncResult::fromCpp(value.result.value()) : nullptr,
|
|
120
|
+
value.error.has_value() ? JLocationError::fromCpp(value.error.value()) : nullptr,
|
|
121
|
+
jni::make_jstring(value.id),
|
|
122
|
+
JBackgroundEventType::fromCpp(value.type),
|
|
123
|
+
value.timestamp,
|
|
124
|
+
value.deliveredToJS
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JBackgroundEventType.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 "BackgroundEventType.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "BackgroundEventType" and the the Kotlin enum "BackgroundEventType".
|
|
19
|
+
*/
|
|
20
|
+
struct JBackgroundEventType final: public jni::JavaClass<JBackgroundEventType> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/BackgroundEventType;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum BackgroundEventType.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
BackgroundEventType 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<BackgroundEventType>(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<JBackgroundEventType> fromCpp(BackgroundEventType value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case BackgroundEventType::ERROR:
|
|
46
|
+
static const auto fieldERROR = clazz->getStaticField<JBackgroundEventType>("ERROR");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldERROR);
|
|
48
|
+
case BackgroundEventType::GEOFENCE:
|
|
49
|
+
static const auto fieldGEOFENCE = clazz->getStaticField<JBackgroundEventType>("GEOFENCE");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldGEOFENCE);
|
|
51
|
+
case BackgroundEventType::LOCATION:
|
|
52
|
+
static const auto fieldLOCATION = clazz->getStaticField<JBackgroundEventType>("LOCATION");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldLOCATION);
|
|
54
|
+
case BackgroundEventType::ACTIVITY:
|
|
55
|
+
static const auto fieldACTIVITY = clazz->getStaticField<JBackgroundEventType>("ACTIVITY");
|
|
56
|
+
return clazz->getStaticFieldValue(fieldACTIVITY);
|
|
57
|
+
case BackgroundEventType::PROVIDERCHANGE:
|
|
58
|
+
static const auto fieldPROVIDERCHANGE = clazz->getStaticField<JBackgroundEventType>("PROVIDERCHANGE");
|
|
59
|
+
return clazz->getStaticFieldValue(fieldPROVIDERCHANGE);
|
|
60
|
+
case BackgroundEventType::HTTPSYNC:
|
|
61
|
+
static const auto fieldHTTPSYNC = clazz->getStaticField<JBackgroundEventType>("HTTPSYNC");
|
|
62
|
+
return clazz->getStaticFieldValue(fieldHTTPSYNC);
|
|
63
|
+
default:
|
|
64
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
65
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JBackgroundHttpMethod.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 "BackgroundHttpMethod.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "BackgroundHttpMethod" and the the Kotlin enum "BackgroundHttpMethod".
|
|
19
|
+
*/
|
|
20
|
+
struct JBackgroundHttpMethod final: public jni::JavaClass<JBackgroundHttpMethod> {
|
|
21
|
+
public:
|
|
22
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/BackgroundHttpMethod;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum BackgroundHttpMethod.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
BackgroundHttpMethod 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<BackgroundHttpMethod>(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<JBackgroundHttpMethod> fromCpp(BackgroundHttpMethod value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case BackgroundHttpMethod::POST:
|
|
46
|
+
static const auto fieldPOST = clazz->getStaticField<JBackgroundHttpMethod>("POST");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldPOST);
|
|
48
|
+
case BackgroundHttpMethod::PUT:
|
|
49
|
+
static const auto fieldPUT = clazz->getStaticField<JBackgroundHttpMethod>("PUT");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldPUT);
|
|
51
|
+
case BackgroundHttpMethod::PATCH:
|
|
52
|
+
static const auto fieldPATCH = clazz->getStaticField<JBackgroundHttpMethod>("PATCH");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldPATCH);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JBackgroundHttpSyncOptions.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 "BackgroundHttpSyncOptions.hpp"
|
|
12
|
+
|
|
13
|
+
#include "BackgroundHttpMethod.hpp"
|
|
14
|
+
#include "JBackgroundHttpMethod.hpp"
|
|
15
|
+
#include "JVariant_NullType_Boolean_String_Double.hpp"
|
|
16
|
+
#include <NitroModules/JNull.hpp>
|
|
17
|
+
#include <NitroModules/Null.hpp>
|
|
18
|
+
#include <optional>
|
|
19
|
+
#include <string>
|
|
20
|
+
#include <unordered_map>
|
|
21
|
+
#include <variant>
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The C++ JNI bridge between the C++ struct "BackgroundHttpSyncOptions" and the the Kotlin data class "BackgroundHttpSyncOptions".
|
|
29
|
+
*/
|
|
30
|
+
struct JBackgroundHttpSyncOptions final: public jni::JavaClass<JBackgroundHttpSyncOptions> {
|
|
31
|
+
public:
|
|
32
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/nitrogeolocation/BackgroundHttpSyncOptions;";
|
|
33
|
+
|
|
34
|
+
public:
|
|
35
|
+
/**
|
|
36
|
+
* Convert this Java/Kotlin-based struct to the C++ struct BackgroundHttpSyncOptions by copying all values to C++.
|
|
37
|
+
*/
|
|
38
|
+
[[maybe_unused]]
|
|
39
|
+
[[nodiscard]]
|
|
40
|
+
BackgroundHttpSyncOptions toCpp() const {
|
|
41
|
+
static const auto clazz = javaClassStatic();
|
|
42
|
+
static const auto fieldUrl = clazz->getField<jni::JString>("url");
|
|
43
|
+
jni::local_ref<jni::JString> url = this->getFieldValue(fieldUrl);
|
|
44
|
+
static const auto fieldMethod = clazz->getField<JBackgroundHttpMethod>("method");
|
|
45
|
+
jni::local_ref<JBackgroundHttpMethod> method = this->getFieldValue(fieldMethod);
|
|
46
|
+
static const auto fieldHeaders = clazz->getField<jni::JMap<jni::JString, jni::JString>>("headers");
|
|
47
|
+
jni::local_ref<jni::JMap<jni::JString, jni::JString>> headers = this->getFieldValue(fieldHeaders);
|
|
48
|
+
static const auto fieldBatch = clazz->getField<jni::JBoolean>("batch");
|
|
49
|
+
jni::local_ref<jni::JBoolean> batch = this->getFieldValue(fieldBatch);
|
|
50
|
+
static const auto fieldBatchSize = clazz->getField<jni::JDouble>("batchSize");
|
|
51
|
+
jni::local_ref<jni::JDouble> batchSize = this->getFieldValue(fieldBatchSize);
|
|
52
|
+
static const auto fieldSyncThreshold = clazz->getField<jni::JDouble>("syncThreshold");
|
|
53
|
+
jni::local_ref<jni::JDouble> syncThreshold = this->getFieldValue(fieldSyncThreshold);
|
|
54
|
+
static const auto fieldSyncInterval = clazz->getField<jni::JDouble>("syncInterval");
|
|
55
|
+
jni::local_ref<jni::JDouble> syncInterval = this->getFieldValue(fieldSyncInterval);
|
|
56
|
+
static const auto fieldRetry = clazz->getField<jni::JBoolean>("retry");
|
|
57
|
+
jni::local_ref<jni::JBoolean> retry = this->getFieldValue(fieldRetry);
|
|
58
|
+
static const auto fieldMaxRetries = clazz->getField<jni::JDouble>("maxRetries");
|
|
59
|
+
jni::local_ref<jni::JDouble> maxRetries = this->getFieldValue(fieldMaxRetries);
|
|
60
|
+
static const auto fieldBodyTemplate = clazz->getField<jni::JMap<jni::JString, JVariant_NullType_Boolean_String_Double>>("bodyTemplate");
|
|
61
|
+
jni::local_ref<jni::JMap<jni::JString, JVariant_NullType_Boolean_String_Double>> bodyTemplate = this->getFieldValue(fieldBodyTemplate);
|
|
62
|
+
static const auto fieldAutoClear = clazz->getField<jni::JBoolean>("autoClear");
|
|
63
|
+
jni::local_ref<jni::JBoolean> autoClear = this->getFieldValue(fieldAutoClear);
|
|
64
|
+
return BackgroundHttpSyncOptions(
|
|
65
|
+
url->toStdString(),
|
|
66
|
+
method != nullptr ? std::make_optional(method->toCpp()) : std::nullopt,
|
|
67
|
+
headers != nullptr ? std::make_optional([&]() {
|
|
68
|
+
std::unordered_map<std::string, std::string> __map;
|
|
69
|
+
__map.reserve(headers->size());
|
|
70
|
+
for (const auto& __entry : *headers) {
|
|
71
|
+
__map.emplace(__entry.first->toStdString(), __entry.second->toStdString());
|
|
72
|
+
}
|
|
73
|
+
return __map;
|
|
74
|
+
}()) : std::nullopt,
|
|
75
|
+
batch != nullptr ? std::make_optional(static_cast<bool>(batch->value())) : std::nullopt,
|
|
76
|
+
batchSize != nullptr ? std::make_optional(batchSize->value()) : std::nullopt,
|
|
77
|
+
syncThreshold != nullptr ? std::make_optional(syncThreshold->value()) : std::nullopt,
|
|
78
|
+
syncInterval != nullptr ? std::make_optional(syncInterval->value()) : std::nullopt,
|
|
79
|
+
retry != nullptr ? std::make_optional(static_cast<bool>(retry->value())) : std::nullopt,
|
|
80
|
+
maxRetries != nullptr ? std::make_optional(maxRetries->value()) : std::nullopt,
|
|
81
|
+
bodyTemplate != nullptr ? std::make_optional([&]() {
|
|
82
|
+
std::unordered_map<std::string, std::variant<nitro::NullType, bool, std::string, double>> __map;
|
|
83
|
+
__map.reserve(bodyTemplate->size());
|
|
84
|
+
for (const auto& __entry : *bodyTemplate) {
|
|
85
|
+
__map.emplace(__entry.first->toStdString(), __entry.second->toCpp());
|
|
86
|
+
}
|
|
87
|
+
return __map;
|
|
88
|
+
}()) : std::nullopt,
|
|
89
|
+
autoClear != nullptr ? std::make_optional(static_cast<bool>(autoClear->value())) : std::nullopt
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public:
|
|
94
|
+
/**
|
|
95
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
96
|
+
*/
|
|
97
|
+
[[maybe_unused]]
|
|
98
|
+
static jni::local_ref<JBackgroundHttpSyncOptions::javaobject> fromCpp(const BackgroundHttpSyncOptions& value) {
|
|
99
|
+
using JSignature = JBackgroundHttpSyncOptions(jni::alias_ref<jni::JString>, jni::alias_ref<JBackgroundHttpMethod>, jni::alias_ref<jni::JMap<jni::JString, jni::JString>>, 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<jni::JDouble>, jni::alias_ref<jni::JMap<jni::JString, JVariant_NullType_Boolean_String_Double>>, jni::alias_ref<jni::JBoolean>);
|
|
100
|
+
static const auto clazz = javaClassStatic();
|
|
101
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
102
|
+
return create(
|
|
103
|
+
clazz,
|
|
104
|
+
jni::make_jstring(value.url),
|
|
105
|
+
value.method.has_value() ? JBackgroundHttpMethod::fromCpp(value.method.value()) : nullptr,
|
|
106
|
+
value.headers.has_value() ? [&]() -> jni::local_ref<jni::JMap<jni::JString, jni::JString>> {
|
|
107
|
+
auto __map = jni::JHashMap<jni::JString, jni::JString>::create(value.headers.value().size());
|
|
108
|
+
for (const auto& __entry : value.headers.value()) {
|
|
109
|
+
__map->put(jni::make_jstring(__entry.first), jni::make_jstring(__entry.second));
|
|
110
|
+
}
|
|
111
|
+
return __map;
|
|
112
|
+
}() : nullptr,
|
|
113
|
+
value.batch.has_value() ? jni::JBoolean::valueOf(value.batch.value()) : nullptr,
|
|
114
|
+
value.batchSize.has_value() ? jni::JDouble::valueOf(value.batchSize.value()) : nullptr,
|
|
115
|
+
value.syncThreshold.has_value() ? jni::JDouble::valueOf(value.syncThreshold.value()) : nullptr,
|
|
116
|
+
value.syncInterval.has_value() ? jni::JDouble::valueOf(value.syncInterval.value()) : nullptr,
|
|
117
|
+
value.retry.has_value() ? jni::JBoolean::valueOf(value.retry.value()) : nullptr,
|
|
118
|
+
value.maxRetries.has_value() ? jni::JDouble::valueOf(value.maxRetries.value()) : nullptr,
|
|
119
|
+
value.bodyTemplate.has_value() ? [&]() -> jni::local_ref<jni::JMap<jni::JString, JVariant_NullType_Boolean_String_Double>> {
|
|
120
|
+
auto __map = jni::JHashMap<jni::JString, JVariant_NullType_Boolean_String_Double>::create(value.bodyTemplate.value().size());
|
|
121
|
+
for (const auto& __entry : value.bodyTemplate.value()) {
|
|
122
|
+
__map->put(jni::make_jstring(__entry.first), JVariant_NullType_Boolean_String_Double::fromCpp(__entry.second));
|
|
123
|
+
}
|
|
124
|
+
return __map;
|
|
125
|
+
}() : nullptr,
|
|
126
|
+
value.autoClear.has_value() ? jni::JBoolean::valueOf(value.autoClear.value()) : nullptr
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
} // namespace margelo::nitro::nitrogeolocation
|