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,90 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GeofencingOptions.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
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `GeofenceTransition` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::nitrogeolocation { enum class GeofenceTransition; }
|
|
33
|
+
|
|
34
|
+
#include "GeofenceTransition.hpp"
|
|
35
|
+
#include <vector>
|
|
36
|
+
#include <optional>
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A struct which can be represented as a JavaScript object (GeofencingOptions).
|
|
42
|
+
*/
|
|
43
|
+
struct GeofencingOptions final {
|
|
44
|
+
public:
|
|
45
|
+
std::optional<std::vector<GeofenceTransition>> initialTrigger SWIFT_PRIVATE;
|
|
46
|
+
std::optional<double> notificationResponsiveness SWIFT_PRIVATE;
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
GeofencingOptions() = default;
|
|
50
|
+
explicit GeofencingOptions(std::optional<std::vector<GeofenceTransition>> initialTrigger, std::optional<double> notificationResponsiveness): initialTrigger(initialTrigger), notificationResponsiveness(notificationResponsiveness) {}
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
friend bool operator==(const GeofencingOptions& lhs, const GeofencingOptions& rhs) = default;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
57
|
+
|
|
58
|
+
namespace margelo::nitro {
|
|
59
|
+
|
|
60
|
+
// C++ GeofencingOptions <> JS GeofencingOptions (object)
|
|
61
|
+
template <>
|
|
62
|
+
struct JSIConverter<margelo::nitro::nitrogeolocation::GeofencingOptions> final {
|
|
63
|
+
static inline margelo::nitro::nitrogeolocation::GeofencingOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
64
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
65
|
+
return margelo::nitro::nitrogeolocation::GeofencingOptions(
|
|
66
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::nitrogeolocation::GeofenceTransition>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "initialTrigger"))),
|
|
67
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "notificationResponsiveness")))
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitrogeolocation::GeofencingOptions& arg) {
|
|
71
|
+
jsi::Object obj(runtime);
|
|
72
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "initialTrigger"), JSIConverter<std::optional<std::vector<margelo::nitro::nitrogeolocation::GeofenceTransition>>>::toJSI(runtime, arg.initialTrigger));
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "notificationResponsiveness"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.notificationResponsiveness));
|
|
74
|
+
return obj;
|
|
75
|
+
}
|
|
76
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
77
|
+
if (!value.isObject()) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
jsi::Object obj = value.getObject(runtime);
|
|
81
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::nitrogeolocation::GeofenceTransition>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "initialTrigger")))) return false;
|
|
85
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "notificationResponsiveness")))) return false;
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GetStoredBackgroundEventsOptions.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
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
// Forward declaration of `BackgroundEventType` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::nitrogeolocation { enum class BackgroundEventType; }
|
|
33
|
+
|
|
34
|
+
#include "BackgroundEventType.hpp"
|
|
35
|
+
#include <vector>
|
|
36
|
+
#include <optional>
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A struct which can be represented as a JavaScript object (GetStoredBackgroundEventsOptions).
|
|
42
|
+
*/
|
|
43
|
+
struct GetStoredBackgroundEventsOptions final {
|
|
44
|
+
public:
|
|
45
|
+
std::optional<std::vector<BackgroundEventType>> types SWIFT_PRIVATE;
|
|
46
|
+
std::optional<double> limit SWIFT_PRIVATE;
|
|
47
|
+
std::optional<double> since SWIFT_PRIVATE;
|
|
48
|
+
std::optional<bool> includeDelivered SWIFT_PRIVATE;
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
GetStoredBackgroundEventsOptions() = default;
|
|
52
|
+
explicit GetStoredBackgroundEventsOptions(std::optional<std::vector<BackgroundEventType>> types, std::optional<double> limit, std::optional<double> since, std::optional<bool> includeDelivered): types(types), limit(limit), since(since), includeDelivered(includeDelivered) {}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
friend bool operator==(const GetStoredBackgroundEventsOptions& lhs, const GetStoredBackgroundEventsOptions& rhs) = default;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
59
|
+
|
|
60
|
+
namespace margelo::nitro {
|
|
61
|
+
|
|
62
|
+
// C++ GetStoredBackgroundEventsOptions <> JS GetStoredBackgroundEventsOptions (object)
|
|
63
|
+
template <>
|
|
64
|
+
struct JSIConverter<margelo::nitro::nitrogeolocation::GetStoredBackgroundEventsOptions> final {
|
|
65
|
+
static inline margelo::nitro::nitrogeolocation::GetStoredBackgroundEventsOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
+
return margelo::nitro::nitrogeolocation::GetStoredBackgroundEventsOptions(
|
|
68
|
+
JSIConverter<std::optional<std::vector<margelo::nitro::nitrogeolocation::BackgroundEventType>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "types"))),
|
|
69
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "limit"))),
|
|
70
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "since"))),
|
|
71
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "includeDelivered")))
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitrogeolocation::GetStoredBackgroundEventsOptions& arg) {
|
|
75
|
+
jsi::Object obj(runtime);
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "types"), JSIConverter<std::optional<std::vector<margelo::nitro::nitrogeolocation::BackgroundEventType>>>::toJSI(runtime, arg.types));
|
|
77
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "limit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "since"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.since));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "includeDelivered"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.includeDelivered));
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
83
|
+
if (!value.isObject()) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
jsi::Object obj = value.getObject(runtime);
|
|
87
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
if (!JSIConverter<std::optional<std::vector<margelo::nitro::nitrogeolocation::BackgroundEventType>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "types")))) return false;
|
|
91
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "limit")))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "since")))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "includeDelivered")))) return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GetStoredBackgroundLocationsOptions.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
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <optional>
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (GetStoredBackgroundLocationsOptions).
|
|
39
|
+
*/
|
|
40
|
+
struct GetStoredBackgroundLocationsOptions final {
|
|
41
|
+
public:
|
|
42
|
+
std::optional<double> limit SWIFT_PRIVATE;
|
|
43
|
+
std::optional<double> since SWIFT_PRIVATE;
|
|
44
|
+
std::optional<bool> includeDelivered SWIFT_PRIVATE;
|
|
45
|
+
std::optional<bool> includeSynced SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
GetStoredBackgroundLocationsOptions() = default;
|
|
49
|
+
explicit GetStoredBackgroundLocationsOptions(std::optional<double> limit, std::optional<double> since, std::optional<bool> includeDelivered, std::optional<bool> includeSynced): limit(limit), since(since), includeDelivered(includeDelivered), includeSynced(includeSynced) {}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
friend bool operator==(const GetStoredBackgroundLocationsOptions& lhs, const GetStoredBackgroundLocationsOptions& rhs) = default;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
56
|
+
|
|
57
|
+
namespace margelo::nitro {
|
|
58
|
+
|
|
59
|
+
// C++ GetStoredBackgroundLocationsOptions <> JS GetStoredBackgroundLocationsOptions (object)
|
|
60
|
+
template <>
|
|
61
|
+
struct JSIConverter<margelo::nitro::nitrogeolocation::GetStoredBackgroundLocationsOptions> final {
|
|
62
|
+
static inline margelo::nitro::nitrogeolocation::GetStoredBackgroundLocationsOptions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
+
return margelo::nitro::nitrogeolocation::GetStoredBackgroundLocationsOptions(
|
|
65
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "limit"))),
|
|
66
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "since"))),
|
|
67
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "includeDelivered"))),
|
|
68
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "includeSynced")))
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitrogeolocation::GetStoredBackgroundLocationsOptions& arg) {
|
|
72
|
+
jsi::Object obj(runtime);
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "limit"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.limit));
|
|
74
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "since"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.since));
|
|
75
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "includeDelivered"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.includeDelivered));
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "includeSynced"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.includeSynced));
|
|
77
|
+
return obj;
|
|
78
|
+
}
|
|
79
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
80
|
+
if (!value.isObject()) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
jsi::Object obj = value.getObject(runtime);
|
|
84
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "limit")))) return false;
|
|
88
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "since")))) return false;
|
|
89
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "includeDelivered")))) return false;
|
|
90
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "includeSynced")))) return false;
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroBackgroundLocationSpec.cpp
|
|
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
|
+
#include "HybridNitroBackgroundLocationSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
11
|
+
|
|
12
|
+
void HybridNitroBackgroundLocationSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("checkBackgroundPermission", &HybridNitroBackgroundLocationSpec::checkBackgroundPermission);
|
|
18
|
+
prototype.registerHybridMethod("requestBackgroundPermission", &HybridNitroBackgroundLocationSpec::requestBackgroundPermission);
|
|
19
|
+
prototype.registerHybridMethod("openAppLocationSettings", &HybridNitroBackgroundLocationSpec::openAppLocationSettings);
|
|
20
|
+
prototype.registerHybridMethod("configureBackgroundLocation", &HybridNitroBackgroundLocationSpec::configureBackgroundLocation);
|
|
21
|
+
prototype.registerHybridMethod("getBackgroundConfiguration", &HybridNitroBackgroundLocationSpec::getBackgroundConfiguration);
|
|
22
|
+
prototype.registerHybridMethod("startBackgroundLocation", &HybridNitroBackgroundLocationSpec::startBackgroundLocation);
|
|
23
|
+
prototype.registerHybridMethod("stopBackgroundLocation", &HybridNitroBackgroundLocationSpec::stopBackgroundLocation);
|
|
24
|
+
prototype.registerHybridMethod("resetBackgroundLocation", &HybridNitroBackgroundLocationSpec::resetBackgroundLocation);
|
|
25
|
+
prototype.registerHybridMethod("getBackgroundLocationStatus", &HybridNitroBackgroundLocationSpec::getBackgroundLocationStatus);
|
|
26
|
+
prototype.registerHybridMethod("addBackgroundEventListener", &HybridNitroBackgroundLocationSpec::addBackgroundEventListener);
|
|
27
|
+
prototype.registerHybridMethod("removeBackgroundEventListener", &HybridNitroBackgroundLocationSpec::removeBackgroundEventListener);
|
|
28
|
+
prototype.registerHybridMethod("addBackgroundLocationListener", &HybridNitroBackgroundLocationSpec::addBackgroundLocationListener);
|
|
29
|
+
prototype.registerHybridMethod("removeBackgroundLocationListener", &HybridNitroBackgroundLocationSpec::removeBackgroundLocationListener);
|
|
30
|
+
prototype.registerHybridMethod("addBackgroundErrorListener", &HybridNitroBackgroundLocationSpec::addBackgroundErrorListener);
|
|
31
|
+
prototype.registerHybridMethod("removeBackgroundErrorListener", &HybridNitroBackgroundLocationSpec::removeBackgroundErrorListener);
|
|
32
|
+
prototype.registerHybridMethod("getStoredBackgroundLocations", &HybridNitroBackgroundLocationSpec::getStoredBackgroundLocations);
|
|
33
|
+
prototype.registerHybridMethod("clearStoredBackgroundLocations", &HybridNitroBackgroundLocationSpec::clearStoredBackgroundLocations);
|
|
34
|
+
prototype.registerHybridMethod("markStoredBackgroundLocationsDelivered", &HybridNitroBackgroundLocationSpec::markStoredBackgroundLocationsDelivered);
|
|
35
|
+
prototype.registerHybridMethod("getStoredBackgroundEvents", &HybridNitroBackgroundLocationSpec::getStoredBackgroundEvents);
|
|
36
|
+
prototype.registerHybridMethod("clearStoredBackgroundEvents", &HybridNitroBackgroundLocationSpec::clearStoredBackgroundEvents);
|
|
37
|
+
prototype.registerHybridMethod("markStoredBackgroundEventsDelivered", &HybridNitroBackgroundLocationSpec::markStoredBackgroundEventsDelivered);
|
|
38
|
+
prototype.registerHybridMethod("addGeofences", &HybridNitroBackgroundLocationSpec::addGeofences);
|
|
39
|
+
prototype.registerHybridMethod("removeGeofences", &HybridNitroBackgroundLocationSpec::removeGeofences);
|
|
40
|
+
prototype.registerHybridMethod("getRegisteredGeofences", &HybridNitroBackgroundLocationSpec::getRegisteredGeofences);
|
|
41
|
+
prototype.registerHybridMethod("startActivityRecognition", &HybridNitroBackgroundLocationSpec::startActivityRecognition);
|
|
42
|
+
prototype.registerHybridMethod("stopActivityRecognition", &HybridNitroBackgroundLocationSpec::stopActivityRecognition);
|
|
43
|
+
prototype.registerHybridMethod("syncStoredLocations", &HybridNitroBackgroundLocationSpec::syncStoredLocations);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroBackgroundLocationSpec.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
|
+
#if __has_include(<NitroModules/HybridObject.hpp>)
|
|
11
|
+
#include <NitroModules/HybridObject.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
// Forward declaration of `BackgroundPermissionResult` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::nitrogeolocation { struct BackgroundPermissionResult; }
|
|
18
|
+
// Forward declaration of `BackgroundLocationOptions` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::nitrogeolocation { struct BackgroundLocationOptions; }
|
|
20
|
+
// Forward declaration of `BackgroundLocationStatus` to properly resolve imports.
|
|
21
|
+
namespace margelo::nitro::nitrogeolocation { struct BackgroundLocationStatus; }
|
|
22
|
+
// Forward declaration of `BackgroundEventEnvelope` to properly resolve imports.
|
|
23
|
+
namespace margelo::nitro::nitrogeolocation { struct BackgroundEventEnvelope; }
|
|
24
|
+
// Forward declaration of `BackgroundLocation` to properly resolve imports.
|
|
25
|
+
namespace margelo::nitro::nitrogeolocation { struct BackgroundLocation; }
|
|
26
|
+
// Forward declaration of `LocationError` to properly resolve imports.
|
|
27
|
+
namespace margelo::nitro::nitrogeolocation { struct LocationError; }
|
|
28
|
+
// Forward declaration of `StoredBackgroundLocation` to properly resolve imports.
|
|
29
|
+
namespace margelo::nitro::nitrogeolocation { struct StoredBackgroundLocation; }
|
|
30
|
+
// Forward declaration of `GetStoredBackgroundLocationsOptions` to properly resolve imports.
|
|
31
|
+
namespace margelo::nitro::nitrogeolocation { struct GetStoredBackgroundLocationsOptions; }
|
|
32
|
+
// Forward declaration of `StoredBackgroundEventEnvelope` to properly resolve imports.
|
|
33
|
+
namespace margelo::nitro::nitrogeolocation { struct StoredBackgroundEventEnvelope; }
|
|
34
|
+
// Forward declaration of `GetStoredBackgroundEventsOptions` to properly resolve imports.
|
|
35
|
+
namespace margelo::nitro::nitrogeolocation { struct GetStoredBackgroundEventsOptions; }
|
|
36
|
+
// Forward declaration of `GeofenceRegion` to properly resolve imports.
|
|
37
|
+
namespace margelo::nitro::nitrogeolocation { struct GeofenceRegion; }
|
|
38
|
+
// Forward declaration of `GeofencingOptions` to properly resolve imports.
|
|
39
|
+
namespace margelo::nitro::nitrogeolocation { struct GeofencingOptions; }
|
|
40
|
+
// Forward declaration of `ActivityRecognitionOptions` to properly resolve imports.
|
|
41
|
+
namespace margelo::nitro::nitrogeolocation { struct ActivityRecognitionOptions; }
|
|
42
|
+
// Forward declaration of `BackgroundHttpSyncResult` to properly resolve imports.
|
|
43
|
+
namespace margelo::nitro::nitrogeolocation { struct BackgroundHttpSyncResult; }
|
|
44
|
+
|
|
45
|
+
#include "BackgroundPermissionResult.hpp"
|
|
46
|
+
#include <NitroModules/Promise.hpp>
|
|
47
|
+
#include "BackgroundLocationOptions.hpp"
|
|
48
|
+
#include <optional>
|
|
49
|
+
#include "BackgroundLocationStatus.hpp"
|
|
50
|
+
#include <string>
|
|
51
|
+
#include "BackgroundEventEnvelope.hpp"
|
|
52
|
+
#include <functional>
|
|
53
|
+
#include "BackgroundLocation.hpp"
|
|
54
|
+
#include "LocationError.hpp"
|
|
55
|
+
#include "StoredBackgroundLocation.hpp"
|
|
56
|
+
#include <vector>
|
|
57
|
+
#include "GetStoredBackgroundLocationsOptions.hpp"
|
|
58
|
+
#include "StoredBackgroundEventEnvelope.hpp"
|
|
59
|
+
#include "GetStoredBackgroundEventsOptions.hpp"
|
|
60
|
+
#include "GeofenceRegion.hpp"
|
|
61
|
+
#include "GeofencingOptions.hpp"
|
|
62
|
+
#include "ActivityRecognitionOptions.hpp"
|
|
63
|
+
#include "BackgroundHttpSyncResult.hpp"
|
|
64
|
+
|
|
65
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
66
|
+
|
|
67
|
+
using namespace margelo::nitro;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* An abstract base class for `NitroBackgroundLocation`
|
|
71
|
+
* Inherit this class to create instances of `HybridNitroBackgroundLocationSpec` in C++.
|
|
72
|
+
* You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
|
|
73
|
+
* @example
|
|
74
|
+
* ```cpp
|
|
75
|
+
* class HybridNitroBackgroundLocation: public HybridNitroBackgroundLocationSpec {
|
|
76
|
+
* public:
|
|
77
|
+
* HybridNitroBackgroundLocation(...): HybridObject(TAG) { ... }
|
|
78
|
+
* // ...
|
|
79
|
+
* };
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
class HybridNitroBackgroundLocationSpec: public virtual HybridObject {
|
|
83
|
+
public:
|
|
84
|
+
// Constructor
|
|
85
|
+
explicit HybridNitroBackgroundLocationSpec(): HybridObject(TAG) { }
|
|
86
|
+
|
|
87
|
+
// Destructor
|
|
88
|
+
~HybridNitroBackgroundLocationSpec() override = default;
|
|
89
|
+
|
|
90
|
+
public:
|
|
91
|
+
// Properties
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
public:
|
|
95
|
+
// Methods
|
|
96
|
+
virtual std::shared_ptr<Promise<BackgroundPermissionResult>> checkBackgroundPermission() = 0;
|
|
97
|
+
virtual std::shared_ptr<Promise<BackgroundPermissionResult>> requestBackgroundPermission() = 0;
|
|
98
|
+
virtual std::shared_ptr<Promise<void>> openAppLocationSettings() = 0;
|
|
99
|
+
virtual std::shared_ptr<Promise<void>> configureBackgroundLocation(const BackgroundLocationOptions& options) = 0;
|
|
100
|
+
virtual std::shared_ptr<Promise<std::optional<BackgroundLocationOptions>>> getBackgroundConfiguration() = 0;
|
|
101
|
+
virtual std::shared_ptr<Promise<void>> startBackgroundLocation(const std::optional<BackgroundLocationOptions>& options) = 0;
|
|
102
|
+
virtual std::shared_ptr<Promise<void>> stopBackgroundLocation() = 0;
|
|
103
|
+
virtual std::shared_ptr<Promise<void>> resetBackgroundLocation() = 0;
|
|
104
|
+
virtual std::shared_ptr<Promise<BackgroundLocationStatus>> getBackgroundLocationStatus() = 0;
|
|
105
|
+
virtual std::string addBackgroundEventListener(const std::function<void(const BackgroundEventEnvelope& /* event */)>& listener) = 0;
|
|
106
|
+
virtual void removeBackgroundEventListener(const std::string& token) = 0;
|
|
107
|
+
virtual std::string addBackgroundLocationListener(const std::function<void(const BackgroundLocation& /* location */)>& listener) = 0;
|
|
108
|
+
virtual void removeBackgroundLocationListener(const std::string& token) = 0;
|
|
109
|
+
virtual std::string addBackgroundErrorListener(const std::function<void(const LocationError& /* error */)>& listener) = 0;
|
|
110
|
+
virtual void removeBackgroundErrorListener(const std::string& token) = 0;
|
|
111
|
+
virtual std::shared_ptr<Promise<std::vector<StoredBackgroundLocation>>> getStoredBackgroundLocations(const std::optional<GetStoredBackgroundLocationsOptions>& options) = 0;
|
|
112
|
+
virtual std::shared_ptr<Promise<void>> clearStoredBackgroundLocations(const std::optional<std::vector<std::string>>& ids) = 0;
|
|
113
|
+
virtual std::shared_ptr<Promise<void>> markStoredBackgroundLocationsDelivered(const std::vector<std::string>& ids) = 0;
|
|
114
|
+
virtual std::shared_ptr<Promise<std::vector<StoredBackgroundEventEnvelope>>> getStoredBackgroundEvents(const std::optional<GetStoredBackgroundEventsOptions>& options) = 0;
|
|
115
|
+
virtual std::shared_ptr<Promise<void>> clearStoredBackgroundEvents(const std::optional<std::vector<std::string>>& ids) = 0;
|
|
116
|
+
virtual std::shared_ptr<Promise<void>> markStoredBackgroundEventsDelivered(const std::vector<std::string>& ids) = 0;
|
|
117
|
+
virtual std::shared_ptr<Promise<void>> addGeofences(const std::vector<GeofenceRegion>& regions, const std::optional<GeofencingOptions>& options) = 0;
|
|
118
|
+
virtual std::shared_ptr<Promise<void>> removeGeofences(const std::optional<std::vector<std::string>>& identifiers) = 0;
|
|
119
|
+
virtual std::shared_ptr<Promise<std::vector<GeofenceRegion>>> getRegisteredGeofences() = 0;
|
|
120
|
+
virtual std::shared_ptr<Promise<void>> startActivityRecognition(const std::optional<ActivityRecognitionOptions>& options) = 0;
|
|
121
|
+
virtual std::shared_ptr<Promise<void>> stopActivityRecognition() = 0;
|
|
122
|
+
virtual std::shared_ptr<Promise<BackgroundHttpSyncResult>> syncStoredLocations() = 0;
|
|
123
|
+
|
|
124
|
+
protected:
|
|
125
|
+
// Hybrid Setup
|
|
126
|
+
void loadHybridMethods() override;
|
|
127
|
+
|
|
128
|
+
protected:
|
|
129
|
+
// Tag for logging
|
|
130
|
+
static constexpr auto TAG = "NitroBackgroundLocation";
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IOSBackgroundActivityType.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
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::nitrogeolocation {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (IOSBackgroundActivityType).
|
|
30
|
+
*/
|
|
31
|
+
enum class IOSBackgroundActivityType {
|
|
32
|
+
OTHER SWIFT_NAME(other) = 0,
|
|
33
|
+
AUTOMOTIVENAVIGATION SWIFT_NAME(automotivenavigation) = 1,
|
|
34
|
+
FITNESS SWIFT_NAME(fitness) = 2,
|
|
35
|
+
OTHERNAVIGATION SWIFT_NAME(othernavigation) = 3,
|
|
36
|
+
AIRBORNE SWIFT_NAME(airborne) = 4,
|
|
37
|
+
} CLOSED_ENUM;
|
|
38
|
+
|
|
39
|
+
} // namespace margelo::nitro::nitrogeolocation
|
|
40
|
+
|
|
41
|
+
namespace margelo::nitro {
|
|
42
|
+
|
|
43
|
+
// C++ IOSBackgroundActivityType <> JS IOSBackgroundActivityType (union)
|
|
44
|
+
template <>
|
|
45
|
+
struct JSIConverter<margelo::nitro::nitrogeolocation::IOSBackgroundActivityType> final {
|
|
46
|
+
static inline margelo::nitro::nitrogeolocation::IOSBackgroundActivityType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
47
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
48
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
49
|
+
case hashString("other"): return margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::OTHER;
|
|
50
|
+
case hashString("automotiveNavigation"): return margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::AUTOMOTIVENAVIGATION;
|
|
51
|
+
case hashString("fitness"): return margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::FITNESS;
|
|
52
|
+
case hashString("otherNavigation"): return margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::OTHERNAVIGATION;
|
|
53
|
+
case hashString("airborne"): return margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::AIRBORNE;
|
|
54
|
+
default: [[unlikely]]
|
|
55
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum IOSBackgroundActivityType - invalid value!");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitrogeolocation::IOSBackgroundActivityType arg) {
|
|
59
|
+
switch (arg) {
|
|
60
|
+
case margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::OTHER: return JSIConverter<std::string>::toJSI(runtime, "other");
|
|
61
|
+
case margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::AUTOMOTIVENAVIGATION: return JSIConverter<std::string>::toJSI(runtime, "automotiveNavigation");
|
|
62
|
+
case margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::FITNESS: return JSIConverter<std::string>::toJSI(runtime, "fitness");
|
|
63
|
+
case margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::OTHERNAVIGATION: return JSIConverter<std::string>::toJSI(runtime, "otherNavigation");
|
|
64
|
+
case margelo::nitro::nitrogeolocation::IOSBackgroundActivityType::AIRBORNE: return JSIConverter<std::string>::toJSI(runtime, "airborne");
|
|
65
|
+
default: [[unlikely]]
|
|
66
|
+
throw std::invalid_argument("Cannot convert IOSBackgroundActivityType to JS - invalid value: "
|
|
67
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
71
|
+
if (!value.isString()) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
75
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
76
|
+
case hashString("other"):
|
|
77
|
+
case hashString("automotiveNavigation"):
|
|
78
|
+
case hashString("fitness"):
|
|
79
|
+
case hashString("otherNavigation"):
|
|
80
|
+
case hashString("airborne"):
|
|
81
|
+
return true;
|
|
82
|
+
default:
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
} // namespace margelo::nitro
|