react-native-nitro-geolocation 1.2.6 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -272
- 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 +711 -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,174 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNitroBackgroundLocationSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.Promise
|
|
14
|
+
import com.margelo.nitro.core.HybridObject
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Kotlin class representing the NitroBackgroundLocation HybridObject.
|
|
18
|
+
* Implement this abstract class to create Kotlin-based instances of NitroBackgroundLocation.
|
|
19
|
+
*/
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
@Suppress(
|
|
23
|
+
"KotlinJniMissingFunction", "unused",
|
|
24
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
+
)
|
|
27
|
+
abstract class HybridNitroBackgroundLocationSpec: HybridObject() {
|
|
28
|
+
// Properties
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Methods
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
abstract fun checkBackgroundPermission(): Promise<BackgroundPermissionResult>
|
|
35
|
+
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
abstract fun requestBackgroundPermission(): Promise<BackgroundPermissionResult>
|
|
39
|
+
|
|
40
|
+
@DoNotStrip
|
|
41
|
+
@Keep
|
|
42
|
+
abstract fun openAppLocationSettings(): Promise<Unit>
|
|
43
|
+
|
|
44
|
+
@DoNotStrip
|
|
45
|
+
@Keep
|
|
46
|
+
abstract fun configureBackgroundLocation(options: BackgroundLocationOptions): Promise<Unit>
|
|
47
|
+
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
abstract fun getBackgroundConfiguration(): Promise<BackgroundLocationOptions?>
|
|
51
|
+
|
|
52
|
+
@DoNotStrip
|
|
53
|
+
@Keep
|
|
54
|
+
abstract fun startBackgroundLocation(options: BackgroundLocationOptions?): Promise<Unit>
|
|
55
|
+
|
|
56
|
+
@DoNotStrip
|
|
57
|
+
@Keep
|
|
58
|
+
abstract fun stopBackgroundLocation(): Promise<Unit>
|
|
59
|
+
|
|
60
|
+
@DoNotStrip
|
|
61
|
+
@Keep
|
|
62
|
+
abstract fun resetBackgroundLocation(): Promise<Unit>
|
|
63
|
+
|
|
64
|
+
@DoNotStrip
|
|
65
|
+
@Keep
|
|
66
|
+
abstract fun getBackgroundLocationStatus(): Promise<BackgroundLocationStatus>
|
|
67
|
+
|
|
68
|
+
abstract fun addBackgroundEventListener(listener: (event: BackgroundEventEnvelope) -> Unit): String
|
|
69
|
+
|
|
70
|
+
@DoNotStrip
|
|
71
|
+
@Keep
|
|
72
|
+
private fun addBackgroundEventListener_cxx(listener: Func_void_BackgroundEventEnvelope): String {
|
|
73
|
+
val __result = addBackgroundEventListener(listener)
|
|
74
|
+
return __result
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@DoNotStrip
|
|
78
|
+
@Keep
|
|
79
|
+
abstract fun removeBackgroundEventListener(token: String): Unit
|
|
80
|
+
|
|
81
|
+
abstract fun addBackgroundLocationListener(listener: (location: BackgroundLocation) -> Unit): String
|
|
82
|
+
|
|
83
|
+
@DoNotStrip
|
|
84
|
+
@Keep
|
|
85
|
+
private fun addBackgroundLocationListener_cxx(listener: Func_void_BackgroundLocation): String {
|
|
86
|
+
val __result = addBackgroundLocationListener(listener)
|
|
87
|
+
return __result
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@DoNotStrip
|
|
91
|
+
@Keep
|
|
92
|
+
abstract fun removeBackgroundLocationListener(token: String): Unit
|
|
93
|
+
|
|
94
|
+
abstract fun addBackgroundErrorListener(listener: (error: LocationError) -> Unit): String
|
|
95
|
+
|
|
96
|
+
@DoNotStrip
|
|
97
|
+
@Keep
|
|
98
|
+
private fun addBackgroundErrorListener_cxx(listener: Func_void_LocationError): String {
|
|
99
|
+
val __result = addBackgroundErrorListener(listener)
|
|
100
|
+
return __result
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@DoNotStrip
|
|
104
|
+
@Keep
|
|
105
|
+
abstract fun removeBackgroundErrorListener(token: String): Unit
|
|
106
|
+
|
|
107
|
+
@DoNotStrip
|
|
108
|
+
@Keep
|
|
109
|
+
abstract fun getStoredBackgroundLocations(options: GetStoredBackgroundLocationsOptions?): Promise<Array<StoredBackgroundLocation>>
|
|
110
|
+
|
|
111
|
+
@DoNotStrip
|
|
112
|
+
@Keep
|
|
113
|
+
abstract fun clearStoredBackgroundLocations(ids: Array<String>?): Promise<Unit>
|
|
114
|
+
|
|
115
|
+
@DoNotStrip
|
|
116
|
+
@Keep
|
|
117
|
+
abstract fun markStoredBackgroundLocationsDelivered(ids: Array<String>): Promise<Unit>
|
|
118
|
+
|
|
119
|
+
@DoNotStrip
|
|
120
|
+
@Keep
|
|
121
|
+
abstract fun getStoredBackgroundEvents(options: GetStoredBackgroundEventsOptions?): Promise<Array<StoredBackgroundEventEnvelope>>
|
|
122
|
+
|
|
123
|
+
@DoNotStrip
|
|
124
|
+
@Keep
|
|
125
|
+
abstract fun clearStoredBackgroundEvents(ids: Array<String>?): Promise<Unit>
|
|
126
|
+
|
|
127
|
+
@DoNotStrip
|
|
128
|
+
@Keep
|
|
129
|
+
abstract fun markStoredBackgroundEventsDelivered(ids: Array<String>): Promise<Unit>
|
|
130
|
+
|
|
131
|
+
@DoNotStrip
|
|
132
|
+
@Keep
|
|
133
|
+
abstract fun addGeofences(regions: Array<GeofenceRegion>, options: GeofencingOptions?): Promise<Unit>
|
|
134
|
+
|
|
135
|
+
@DoNotStrip
|
|
136
|
+
@Keep
|
|
137
|
+
abstract fun removeGeofences(identifiers: Array<String>?): Promise<Unit>
|
|
138
|
+
|
|
139
|
+
@DoNotStrip
|
|
140
|
+
@Keep
|
|
141
|
+
abstract fun getRegisteredGeofences(): Promise<Array<GeofenceRegion>>
|
|
142
|
+
|
|
143
|
+
@DoNotStrip
|
|
144
|
+
@Keep
|
|
145
|
+
abstract fun startActivityRecognition(options: ActivityRecognitionOptions?): Promise<Unit>
|
|
146
|
+
|
|
147
|
+
@DoNotStrip
|
|
148
|
+
@Keep
|
|
149
|
+
abstract fun stopActivityRecognition(): Promise<Unit>
|
|
150
|
+
|
|
151
|
+
@DoNotStrip
|
|
152
|
+
@Keep
|
|
153
|
+
abstract fun syncStoredLocations(): Promise<BackgroundHttpSyncResult>
|
|
154
|
+
|
|
155
|
+
// Default implementation of `HybridObject.toString()`
|
|
156
|
+
override fun toString(): String {
|
|
157
|
+
return "[HybridObject NitroBackgroundLocation]"
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// C++ backing class
|
|
161
|
+
@DoNotStrip
|
|
162
|
+
@Keep
|
|
163
|
+
protected open class CxxPart(javaPart: HybridNitroBackgroundLocationSpec): HybridObject.CxxPart(javaPart) {
|
|
164
|
+
// C++ JHybridNitroBackgroundLocationSpec::CxxPart::initHybrid(...)
|
|
165
|
+
external override fun initHybrid(): HybridData
|
|
166
|
+
}
|
|
167
|
+
override fun createCxxPart(): CxxPart {
|
|
168
|
+
return CxxPart(this)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
companion object {
|
|
172
|
+
protected const val TAG = "HybridNitroBackgroundLocationSpec"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IOSBackgroundActivityType.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "IOSBackgroundActivityType".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class IOSBackgroundActivityType(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
OTHER(0),
|
|
20
|
+
AUTOMOTIVENAVIGATION(1),
|
|
21
|
+
FITNESS(2),
|
|
22
|
+
OTHERNAVIGATION(3),
|
|
23
|
+
AIRBORNE(4);
|
|
24
|
+
|
|
25
|
+
companion object
|
|
26
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IOSBackgroundLocationOptions.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "IOSBackgroundLocationOptions".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class IOSBackgroundLocationOptions(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val activityType: IOSBackgroundActivityType?,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val pausesLocationUpdatesAutomatically: Boolean?,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val showsBackgroundLocationIndicator: Boolean?,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val useSignificantChanges: Boolean?,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val deferredUpdatesDistance: Double?,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val deferredUpdatesInterval: Double?
|
|
39
|
+
) {
|
|
40
|
+
/* primary constructor */
|
|
41
|
+
|
|
42
|
+
override fun equals(other: Any?): Boolean {
|
|
43
|
+
if (this === other) return true
|
|
44
|
+
if (other !is IOSBackgroundLocationOptions) return false
|
|
45
|
+
return Objects.deepEquals(this.activityType, other.activityType)
|
|
46
|
+
&& Objects.deepEquals(this.pausesLocationUpdatesAutomatically, other.pausesLocationUpdatesAutomatically)
|
|
47
|
+
&& Objects.deepEquals(this.showsBackgroundLocationIndicator, other.showsBackgroundLocationIndicator)
|
|
48
|
+
&& Objects.deepEquals(this.useSignificantChanges, other.useSignificantChanges)
|
|
49
|
+
&& Objects.deepEquals(this.deferredUpdatesDistance, other.deferredUpdatesDistance)
|
|
50
|
+
&& Objects.deepEquals(this.deferredUpdatesInterval, other.deferredUpdatesInterval)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override fun hashCode(): Int {
|
|
54
|
+
return arrayOf(
|
|
55
|
+
activityType,
|
|
56
|
+
pausesLocationUpdatesAutomatically,
|
|
57
|
+
showsBackgroundLocationIndicator,
|
|
58
|
+
useSignificantChanges,
|
|
59
|
+
deferredUpdatesDistance,
|
|
60
|
+
deferredUpdatesInterval
|
|
61
|
+
).contentDeepHashCode()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
companion object {
|
|
65
|
+
/**
|
|
66
|
+
* Constructor called from C++
|
|
67
|
+
*/
|
|
68
|
+
@DoNotStrip
|
|
69
|
+
@Keep
|
|
70
|
+
@Suppress("unused")
|
|
71
|
+
@JvmStatic
|
|
72
|
+
private fun fromCpp(activityType: IOSBackgroundActivityType?, pausesLocationUpdatesAutomatically: Boolean?, showsBackgroundLocationIndicator: Boolean?, useSignificantChanges: Boolean?, deferredUpdatesDistance: Double?, deferredUpdatesInterval: Double?): IOSBackgroundLocationOptions {
|
|
73
|
+
return IOSBackgroundLocationOptions(activityType, pausesLocationUpdatesAutomatically, showsBackgroundLocationIndicator, useSignificantChanges, deferredUpdatesDistance, deferredUpdatesInterval)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// IOSBackgroundLocationStatus.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "IOSBackgroundLocationStatus".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class IOSBackgroundLocationStatus(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val allowsBackgroundLocationUpdates: Boolean,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val significantChangesEnabled: Boolean
|
|
27
|
+
) {
|
|
28
|
+
/* primary constructor */
|
|
29
|
+
|
|
30
|
+
override fun equals(other: Any?): Boolean {
|
|
31
|
+
if (this === other) return true
|
|
32
|
+
if (other !is IOSBackgroundLocationStatus) return false
|
|
33
|
+
return Objects.deepEquals(this.allowsBackgroundLocationUpdates, other.allowsBackgroundLocationUpdates)
|
|
34
|
+
&& Objects.deepEquals(this.significantChangesEnabled, other.significantChangesEnabled)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun hashCode(): Int {
|
|
38
|
+
return arrayOf(
|
|
39
|
+
allowsBackgroundLocationUpdates,
|
|
40
|
+
significantChangesEnabled
|
|
41
|
+
).contentDeepHashCode()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
companion object {
|
|
45
|
+
/**
|
|
46
|
+
* Constructor called from C++
|
|
47
|
+
*/
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
@Suppress("unused")
|
|
51
|
+
@JvmStatic
|
|
52
|
+
private fun fromCpp(allowsBackgroundLocationUpdates: Boolean, significantChangesEnabled: Boolean): IOSBackgroundLocationStatus {
|
|
53
|
+
return IOSBackgroundLocationStatus(allowsBackgroundLocationUpdates, significantChangesEnabled)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -35,6 +35,9 @@ data class LocationProviderStatus(
|
|
|
35
35
|
val passiveAvailable: Boolean?,
|
|
36
36
|
@DoNotStrip
|
|
37
37
|
@Keep
|
|
38
|
+
val googlePlayServicesAvailable: Boolean?,
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
38
41
|
val googleLocationAccuracyEnabled: Boolean?
|
|
39
42
|
) {
|
|
40
43
|
/* primary constructor */
|
|
@@ -47,6 +50,7 @@ data class LocationProviderStatus(
|
|
|
47
50
|
&& Objects.deepEquals(this.gpsAvailable, other.gpsAvailable)
|
|
48
51
|
&& Objects.deepEquals(this.networkAvailable, other.networkAvailable)
|
|
49
52
|
&& Objects.deepEquals(this.passiveAvailable, other.passiveAvailable)
|
|
53
|
+
&& Objects.deepEquals(this.googlePlayServicesAvailable, other.googlePlayServicesAvailable)
|
|
50
54
|
&& Objects.deepEquals(this.googleLocationAccuracyEnabled, other.googleLocationAccuracyEnabled)
|
|
51
55
|
}
|
|
52
56
|
|
|
@@ -57,6 +61,7 @@ data class LocationProviderStatus(
|
|
|
57
61
|
gpsAvailable,
|
|
58
62
|
networkAvailable,
|
|
59
63
|
passiveAvailable,
|
|
64
|
+
googlePlayServicesAvailable,
|
|
60
65
|
googleLocationAccuracyEnabled
|
|
61
66
|
).contentDeepHashCode()
|
|
62
67
|
}
|
|
@@ -69,8 +74,8 @@ data class LocationProviderStatus(
|
|
|
69
74
|
@Keep
|
|
70
75
|
@Suppress("unused")
|
|
71
76
|
@JvmStatic
|
|
72
|
-
private fun fromCpp(locationServicesEnabled: Boolean, backgroundModeEnabled: Boolean, gpsAvailable: Boolean?, networkAvailable: Boolean?, passiveAvailable: Boolean?, googleLocationAccuracyEnabled: Boolean?): LocationProviderStatus {
|
|
73
|
-
return LocationProviderStatus(locationServicesEnabled, backgroundModeEnabled, gpsAvailable, networkAvailable, passiveAvailable, googleLocationAccuracyEnabled)
|
|
77
|
+
private fun fromCpp(locationServicesEnabled: Boolean, backgroundModeEnabled: Boolean, gpsAvailable: Boolean?, networkAvailable: Boolean?, passiveAvailable: Boolean?, googlePlayServicesAvailable: Boolean?, googleLocationAccuracyEnabled: Boolean?): LocationProviderStatus {
|
|
78
|
+
return LocationProviderStatus(locationServicesEnabled, backgroundModeEnabled, gpsAvailable, networkAvailable, passiveAvailable, googlePlayServicesAvailable, googleLocationAccuracyEnabled)
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// StoredBackgroundEventEnvelope.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "StoredBackgroundEventEnvelope".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class StoredBackgroundEventEnvelope(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val event: BackgroundEventEnvelope,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val createdAt: Double,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val id: String,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val type: BackgroundEventType,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val timestamp: Double,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val deliveredToJS: Boolean
|
|
39
|
+
) {
|
|
40
|
+
/* primary constructor */
|
|
41
|
+
|
|
42
|
+
override fun equals(other: Any?): Boolean {
|
|
43
|
+
if (this === other) return true
|
|
44
|
+
if (other !is StoredBackgroundEventEnvelope) return false
|
|
45
|
+
return Objects.deepEquals(this.event, other.event)
|
|
46
|
+
&& Objects.deepEquals(this.createdAt, other.createdAt)
|
|
47
|
+
&& Objects.deepEquals(this.id, other.id)
|
|
48
|
+
&& Objects.deepEquals(this.type, other.type)
|
|
49
|
+
&& Objects.deepEquals(this.timestamp, other.timestamp)
|
|
50
|
+
&& Objects.deepEquals(this.deliveredToJS, other.deliveredToJS)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override fun hashCode(): Int {
|
|
54
|
+
return arrayOf(
|
|
55
|
+
event,
|
|
56
|
+
createdAt,
|
|
57
|
+
id,
|
|
58
|
+
type,
|
|
59
|
+
timestamp,
|
|
60
|
+
deliveredToJS
|
|
61
|
+
).contentDeepHashCode()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
companion object {
|
|
65
|
+
/**
|
|
66
|
+
* Constructor called from C++
|
|
67
|
+
*/
|
|
68
|
+
@DoNotStrip
|
|
69
|
+
@Keep
|
|
70
|
+
@Suppress("unused")
|
|
71
|
+
@JvmStatic
|
|
72
|
+
private fun fromCpp(event: BackgroundEventEnvelope, createdAt: Double, id: String, type: BackgroundEventType, timestamp: Double, deliveredToJS: Boolean): StoredBackgroundEventEnvelope {
|
|
73
|
+
return StoredBackgroundEventEnvelope(event, createdAt, id, type, timestamp, deliveredToJS)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// StoredBackgroundLocation.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import java.util.Objects
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Represents the JavaScript object/struct "StoredBackgroundLocation".
|
|
17
|
+
*/
|
|
18
|
+
@DoNotStrip
|
|
19
|
+
@Keep
|
|
20
|
+
data class StoredBackgroundLocation(
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
val id: String,
|
|
24
|
+
@DoNotStrip
|
|
25
|
+
@Keep
|
|
26
|
+
val deliveredToJS: Boolean,
|
|
27
|
+
@DoNotStrip
|
|
28
|
+
@Keep
|
|
29
|
+
val synced: Boolean,
|
|
30
|
+
@DoNotStrip
|
|
31
|
+
@Keep
|
|
32
|
+
val createdAt: Double,
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
val source: BackgroundLocationSource,
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
val isFromBackground: Boolean,
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
val provider: LocationProviderUsed?,
|
|
42
|
+
@DoNotStrip
|
|
43
|
+
@Keep
|
|
44
|
+
val mocked: Boolean?,
|
|
45
|
+
@DoNotStrip
|
|
46
|
+
@Keep
|
|
47
|
+
val recordedAt: Double,
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
val activity: DetectedActivity?,
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
val battery: BatterySnapshot?,
|
|
54
|
+
@DoNotStrip
|
|
55
|
+
@Keep
|
|
56
|
+
val coords: GeolocationCoordinates,
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
val timestamp: Double
|
|
60
|
+
) {
|
|
61
|
+
/* primary constructor */
|
|
62
|
+
|
|
63
|
+
override fun equals(other: Any?): Boolean {
|
|
64
|
+
if (this === other) return true
|
|
65
|
+
if (other !is StoredBackgroundLocation) return false
|
|
66
|
+
return Objects.deepEquals(this.id, other.id)
|
|
67
|
+
&& Objects.deepEquals(this.deliveredToJS, other.deliveredToJS)
|
|
68
|
+
&& Objects.deepEquals(this.synced, other.synced)
|
|
69
|
+
&& Objects.deepEquals(this.createdAt, other.createdAt)
|
|
70
|
+
&& Objects.deepEquals(this.source, other.source)
|
|
71
|
+
&& Objects.deepEquals(this.isFromBackground, other.isFromBackground)
|
|
72
|
+
&& Objects.deepEquals(this.provider, other.provider)
|
|
73
|
+
&& Objects.deepEquals(this.mocked, other.mocked)
|
|
74
|
+
&& Objects.deepEquals(this.recordedAt, other.recordedAt)
|
|
75
|
+
&& Objects.deepEquals(this.activity, other.activity)
|
|
76
|
+
&& Objects.deepEquals(this.battery, other.battery)
|
|
77
|
+
&& Objects.deepEquals(this.coords, other.coords)
|
|
78
|
+
&& Objects.deepEquals(this.timestamp, other.timestamp)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
override fun hashCode(): Int {
|
|
82
|
+
return arrayOf(
|
|
83
|
+
id,
|
|
84
|
+
deliveredToJS,
|
|
85
|
+
synced,
|
|
86
|
+
createdAt,
|
|
87
|
+
source,
|
|
88
|
+
isFromBackground,
|
|
89
|
+
provider,
|
|
90
|
+
mocked,
|
|
91
|
+
recordedAt,
|
|
92
|
+
activity,
|
|
93
|
+
battery,
|
|
94
|
+
coords,
|
|
95
|
+
timestamp
|
|
96
|
+
).contentDeepHashCode()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
companion object {
|
|
100
|
+
/**
|
|
101
|
+
* Constructor called from C++
|
|
102
|
+
*/
|
|
103
|
+
@DoNotStrip
|
|
104
|
+
@Keep
|
|
105
|
+
@Suppress("unused")
|
|
106
|
+
@JvmStatic
|
|
107
|
+
private fun fromCpp(id: String, deliveredToJS: Boolean, synced: Boolean, createdAt: Double, source: BackgroundLocationSource, isFromBackground: Boolean, provider: LocationProviderUsed?, mocked: Boolean?, recordedAt: Double, activity: DetectedActivity?, battery: BatterySnapshot?, coords: GeolocationCoordinates, timestamp: Double): StoredBackgroundLocation {
|
|
108
|
+
return StoredBackgroundLocation(id, deliveredToJS, synced, createdAt, source, isFromBackground, provider, mocked, recordedAt, activity, battery, coords, timestamp)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType_Boolean_String_Double.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.nitrogeolocation
|
|
9
|
+
|
|
10
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
11
|
+
import com.margelo.nitro.core.NullType
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the TypeScript variant "NullType | Boolean | String | Double".
|
|
15
|
+
*/
|
|
16
|
+
@Suppress("ClassName")
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
sealed class Variant_NullType_Boolean_String_Double {
|
|
19
|
+
@DoNotStrip
|
|
20
|
+
data class First(@DoNotStrip val value: NullType): Variant_NullType_Boolean_String_Double()
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
data class Second(@DoNotStrip val value: Boolean): Variant_NullType_Boolean_String_Double()
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
data class Third(@DoNotStrip val value: String): Variant_NullType_Boolean_String_Double()
|
|
25
|
+
@DoNotStrip
|
|
26
|
+
data class Fourth(@DoNotStrip val value: Double): Variant_NullType_Boolean_String_Double()
|
|
27
|
+
|
|
28
|
+
inline fun <reified T> asType(): T? {
|
|
29
|
+
return when (this) {
|
|
30
|
+
is First -> (value) as? T
|
|
31
|
+
is Second -> (value) as? T
|
|
32
|
+
is Third -> (value) as? T
|
|
33
|
+
is Fourth -> (value) as? T
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
inline fun <reified T> isType(): Boolean {
|
|
37
|
+
return asType<T>() != null
|
|
38
|
+
}
|
|
39
|
+
inline fun <R> match(first: (NullType) -> R, second: (Boolean) -> R, third: (String) -> R, fourth: (Double) -> R): R {
|
|
40
|
+
return when (this) {
|
|
41
|
+
is First -> first(value)
|
|
42
|
+
is Second -> second(value)
|
|
43
|
+
is Third -> third(value)
|
|
44
|
+
is Fourth -> fourth(value)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
val isFirst: Boolean
|
|
49
|
+
get() = this is First
|
|
50
|
+
val isSecond: Boolean
|
|
51
|
+
get() = this is Second
|
|
52
|
+
val isThird: Boolean
|
|
53
|
+
get() = this is Third
|
|
54
|
+
val isFourth: Boolean
|
|
55
|
+
get() = this is Fourth
|
|
56
|
+
|
|
57
|
+
fun asFirstOrNull(): NullType? {
|
|
58
|
+
val value = (this as? First)?.value ?: return null
|
|
59
|
+
return value
|
|
60
|
+
}
|
|
61
|
+
fun asSecondOrNull(): Boolean? {
|
|
62
|
+
val value = (this as? Second)?.value ?: return null
|
|
63
|
+
return value
|
|
64
|
+
}
|
|
65
|
+
fun asThirdOrNull(): String? {
|
|
66
|
+
val value = (this as? Third)?.value ?: return null
|
|
67
|
+
return value
|
|
68
|
+
}
|
|
69
|
+
fun asFourthOrNull(): Double? {
|
|
70
|
+
val value = (this as? Fourth)?.value ?: return null
|
|
71
|
+
return value
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
companion object {
|
|
75
|
+
@JvmStatic
|
|
76
|
+
@DoNotStrip
|
|
77
|
+
fun create(value: NullType): Variant_NullType_Boolean_String_Double = First(value)
|
|
78
|
+
@JvmStatic
|
|
79
|
+
@DoNotStrip
|
|
80
|
+
fun create(value: Boolean): Variant_NullType_Boolean_String_Double = Second(value)
|
|
81
|
+
@JvmStatic
|
|
82
|
+
@DoNotStrip
|
|
83
|
+
fun create(value: String): Variant_NullType_Boolean_String_Double = Third(value)
|
|
84
|
+
@JvmStatic
|
|
85
|
+
@DoNotStrip
|
|
86
|
+
fun create(value: Double): Variant_NullType_Boolean_String_Double = Fourth(value)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -35,10 +35,13 @@ target_sources(
|
|
|
35
35
|
# Shared Nitrogen C++ sources
|
|
36
36
|
../nitrogen/generated/shared/c++/HybridNitroGeolocationSpec.cpp
|
|
37
37
|
../nitrogen/generated/shared/c++/HybridNitroGeolocationCompatSpec.cpp
|
|
38
|
+
../nitrogen/generated/shared/c++/HybridNitroBackgroundLocationSpec.cpp
|
|
38
39
|
# Android-specific Nitrogen C++ sources
|
|
39
40
|
../nitrogen/generated/android/c++/JHybridNitroGeolocationSpec.cpp
|
|
40
41
|
../nitrogen/generated/android/c++/JNullableDouble.cpp
|
|
41
42
|
../nitrogen/generated/android/c++/JHybridNitroGeolocationCompatSpec.cpp
|
|
43
|
+
../nitrogen/generated/android/c++/JHybridNitroBackgroundLocationSpec.cpp
|
|
44
|
+
../nitrogen/generated/android/c++/JVariant_NullType_Boolean_String_Double.cpp
|
|
42
45
|
)
|
|
43
46
|
|
|
44
47
|
# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
|