react-native-nitro-location-tracking 0.1.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/LICENSE +20 -0
- package/NitroLocationTracking.podspec +29 -0
- package/README.md +39 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +122 -0
- package/android/src/main/AndroidManifest.xml +18 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/nitrolocationtracking/ConnectionManager.kt +137 -0
- package/android/src/main/java/com/margelo/nitro/nitrolocationtracking/LocationEngine.kt +93 -0
- package/android/src/main/java/com/margelo/nitro/nitrolocationtracking/LocationForegroundService.kt +65 -0
- package/android/src/main/java/com/margelo/nitro/nitrolocationtracking/NativeDBWriter.kt +80 -0
- package/android/src/main/java/com/margelo/nitro/nitrolocationtracking/NitroLocationTracking.kt +180 -0
- package/android/src/main/java/com/margelo/nitro/nitrolocationtracking/NitroLocationTrackingPackage.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/nitrolocationtracking/NotificationService.kt +75 -0
- package/ios/ConnectionManager.swift +144 -0
- package/ios/LocationEngine.swift +146 -0
- package/ios/NativeDBWriter.swift +121 -0
- package/ios/NitroLocationTracking.swift +127 -0
- package/ios/NotificationService.swift +31 -0
- package/lib/module/LocationSmoother.js +33 -0
- package/lib/module/LocationSmoother.js.map +1 -0
- package/lib/module/NitroLocationTracking.nitro.js +4 -0
- package/lib/module/NitroLocationTracking.nitro.js.map +1 -0
- package/lib/module/bearing.js +19 -0
- package/lib/module/bearing.js.map +1 -0
- package/lib/module/db.js +234 -0
- package/lib/module/db.js.map +1 -0
- package/lib/module/index.js +68 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/LocationSmoother.d.ts +19 -0
- package/lib/typescript/src/LocationSmoother.d.ts.map +1 -0
- package/lib/typescript/src/NitroLocationTracking.nitro.d.ts +59 -0
- package/lib/typescript/src/NitroLocationTracking.nitro.d.ts.map +1 -0
- package/lib/typescript/src/bearing.d.ts +9 -0
- package/lib/typescript/src/bearing.d.ts.map +1 -0
- package/lib/typescript/src/db.d.ts +1 -0
- package/lib/typescript/src/db.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +21 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +17 -0
- package/nitrogen/generated/android/c++/JAccuracyLevel.hpp +61 -0
- package/nitrogen/generated/android/c++/JConnectionConfig.hpp +81 -0
- package/nitrogen/generated/android/c++/JConnectionState.hpp +61 -0
- package/nitrogen/generated/android/c++/JFunc_void_ConnectionState.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_LocationData.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridNitroLocationTrackingSpec.cpp +179 -0
- package/nitrogen/generated/android/c++/JHybridNitroLocationTrackingSpec.hpp +83 -0
- package/nitrogen/generated/android/c++/JLocationConfig.hpp +91 -0
- package/nitrogen/generated/android/c++/JLocationData.hpp +81 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/AccuracyLevel.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/ConnectionConfig.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/ConnectionState.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/Func_void_ConnectionState.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/Func_void_LocationData.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/Func_void_bool.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/HybridNitroLocationTrackingSpec.kt +146 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/LocationConfig.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/LocationData.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrolocationtracking/nitrolocationtrackingOnLoad.kt +35 -0
- package/nitrogen/generated/android/nitrolocationtracking+autolinking.cmake +81 -0
- package/nitrogen/generated/android/nitrolocationtracking+autolinking.gradle +27 -0
- package/nitrogen/generated/android/nitrolocationtrackingOnLoad.cpp +52 -0
- package/nitrogen/generated/android/nitrolocationtrackingOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/NitroLocationTracking+autolinking.rb +60 -0
- package/nitrogen/generated/ios/NitroLocationTracking-Swift-Cxx-Bridge.cpp +73 -0
- package/nitrogen/generated/ios/NitroLocationTracking-Swift-Cxx-Bridge.hpp +231 -0
- package/nitrogen/generated/ios/NitroLocationTracking-Swift-Cxx-Umbrella.hpp +61 -0
- package/nitrogen/generated/ios/NitroLocationTrackingAutolinking.mm +33 -0
- package/nitrogen/generated/ios/NitroLocationTrackingAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridNitroLocationTrackingSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNitroLocationTrackingSpecSwift.hpp +206 -0
- package/nitrogen/generated/ios/swift/AccuracyLevel.swift +44 -0
- package/nitrogen/generated/ios/swift/ConnectionConfig.swift +59 -0
- package/nitrogen/generated/ios/swift/ConnectionState.swift +44 -0
- package/nitrogen/generated/ios/swift/Func_void_ConnectionState.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_LocationData.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridNitroLocationTrackingSpec.swift +72 -0
- package/nitrogen/generated/ios/swift/HybridNitroLocationTrackingSpec_cxx.swift +362 -0
- package/nitrogen/generated/ios/swift/LocationConfig.swift +69 -0
- package/nitrogen/generated/ios/swift/LocationData.swift +59 -0
- package/nitrogen/generated/shared/c++/AccuracyLevel.hpp +80 -0
- package/nitrogen/generated/shared/c++/ConnectionConfig.hpp +107 -0
- package/nitrogen/generated/shared/c++/ConnectionState.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridNitroLocationTrackingSpec.cpp +38 -0
- package/nitrogen/generated/shared/c++/HybridNitroLocationTrackingSpec.hpp +92 -0
- package/nitrogen/generated/shared/c++/LocationConfig.hpp +117 -0
- package/nitrogen/generated/shared/c++/LocationData.hpp +107 -0
- package/package.json +174 -0
- package/src/LocationSmoother.ts +46 -0
- package/src/NitroLocationTracking.nitro.ts +79 -0
- package/src/bearing.ts +22 -0
- package/src/db.ts +232 -0
- package/src/index.tsx +92 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { NitroLocationTracking, LocationData, LocationConfig, ConnectionConfig } from './NitroLocationTracking.nitro';
|
|
2
|
+
declare const NitroLocationModule: NitroLocationTracking;
|
|
3
|
+
export default NitroLocationModule;
|
|
4
|
+
export { LocationSmoother } from './LocationSmoother';
|
|
5
|
+
export { shortestRotation, calculateBearing } from './bearing';
|
|
6
|
+
export type { NitroLocationTracking, LocationData, LocationConfig, ConnectionConfig, } from './NitroLocationTracking.nitro';
|
|
7
|
+
export declare function useDriverLocation(config: LocationConfig): {
|
|
8
|
+
location: LocationData | null;
|
|
9
|
+
isMoving: boolean;
|
|
10
|
+
isTracking: boolean;
|
|
11
|
+
startTracking: () => void;
|
|
12
|
+
stopTracking: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare function useRideConnection(config: ConnectionConfig): {
|
|
15
|
+
connectionState: "connected" | "disconnected" | "reconnecting";
|
|
16
|
+
lastMessage: string | null;
|
|
17
|
+
connect: () => void;
|
|
18
|
+
disconnect: () => void;
|
|
19
|
+
send: (m: string) => void;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,QAAA,MAAM,mBAAmB,uBAGtB,CAAC;AAEJ,eAAe,mBAAmB,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE/D,YAAY,EACV,qBAAqB,EACrB,YAAY,EACZ,cAAc,EACd,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AAEvC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc;;;;;;EAuCvD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB;;;;;cAuBhC,MAAM;EAE/B"}
|
package/nitro.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cxxNamespace": ["nitrolocationtracking"],
|
|
3
|
+
"ios": {
|
|
4
|
+
"iosModuleName": "NitroLocationTracking"
|
|
5
|
+
},
|
|
6
|
+
"android": {
|
|
7
|
+
"androidNamespace": ["nitrolocationtracking"],
|
|
8
|
+
"androidCxxLibName": "nitrolocationtracking"
|
|
9
|
+
},
|
|
10
|
+
"autolinking": {
|
|
11
|
+
"NitroLocationTracking": {
|
|
12
|
+
"swift": "NitroLocationTracking",
|
|
13
|
+
"kotlin": "NitroLocationTracking"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"ignorePaths": ["node_modules"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JAccuracyLevel.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "AccuracyLevel.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitrolocationtracking {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "AccuracyLevel" and the the Kotlin enum "AccuracyLevel".
|
|
19
|
+
*/
|
|
20
|
+
struct JAccuracyLevel final: public jni::JavaClass<JAccuracyLevel> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/AccuracyLevel;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum AccuracyLevel.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
AccuracyLevel toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<AccuracyLevel>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JAccuracyLevel> fromCpp(AccuracyLevel value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case AccuracyLevel::HIGH:
|
|
46
|
+
static const auto fieldHIGH = clazz->getStaticField<JAccuracyLevel>("HIGH");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldHIGH);
|
|
48
|
+
case AccuracyLevel::BALANCED:
|
|
49
|
+
static const auto fieldBALANCED = clazz->getStaticField<JAccuracyLevel>("BALANCED");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldBALANCED);
|
|
51
|
+
case AccuracyLevel::LOW:
|
|
52
|
+
static const auto fieldLOW = clazz->getStaticField<JAccuracyLevel>("LOW");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldLOW);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitrolocationtracking
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JConnectionConfig.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "ConnectionConfig.hpp"
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::nitrolocationtracking {
|
|
16
|
+
|
|
17
|
+
using namespace facebook;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The C++ JNI bridge between the C++ struct "ConnectionConfig" and the the Kotlin data class "ConnectionConfig".
|
|
21
|
+
*/
|
|
22
|
+
struct JConnectionConfig final: public jni::JavaClass<JConnectionConfig> {
|
|
23
|
+
public:
|
|
24
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/ConnectionConfig;";
|
|
25
|
+
|
|
26
|
+
public:
|
|
27
|
+
/**
|
|
28
|
+
* Convert this Java/Kotlin-based struct to the C++ struct ConnectionConfig by copying all values to C++.
|
|
29
|
+
*/
|
|
30
|
+
[[maybe_unused]]
|
|
31
|
+
[[nodiscard]]
|
|
32
|
+
ConnectionConfig toCpp() const {
|
|
33
|
+
static const auto clazz = javaClassStatic();
|
|
34
|
+
static const auto fieldWsUrl = clazz->getField<jni::JString>("wsUrl");
|
|
35
|
+
jni::local_ref<jni::JString> wsUrl = this->getFieldValue(fieldWsUrl);
|
|
36
|
+
static const auto fieldRestUrl = clazz->getField<jni::JString>("restUrl");
|
|
37
|
+
jni::local_ref<jni::JString> restUrl = this->getFieldValue(fieldRestUrl);
|
|
38
|
+
static const auto fieldAuthToken = clazz->getField<jni::JString>("authToken");
|
|
39
|
+
jni::local_ref<jni::JString> authToken = this->getFieldValue(fieldAuthToken);
|
|
40
|
+
static const auto fieldReconnectIntervalMs = clazz->getField<double>("reconnectIntervalMs");
|
|
41
|
+
double reconnectIntervalMs = this->getFieldValue(fieldReconnectIntervalMs);
|
|
42
|
+
static const auto fieldMaxReconnectAttempts = clazz->getField<double>("maxReconnectAttempts");
|
|
43
|
+
double maxReconnectAttempts = this->getFieldValue(fieldMaxReconnectAttempts);
|
|
44
|
+
static const auto fieldBatchSize = clazz->getField<double>("batchSize");
|
|
45
|
+
double batchSize = this->getFieldValue(fieldBatchSize);
|
|
46
|
+
static const auto fieldSyncIntervalMs = clazz->getField<double>("syncIntervalMs");
|
|
47
|
+
double syncIntervalMs = this->getFieldValue(fieldSyncIntervalMs);
|
|
48
|
+
return ConnectionConfig(
|
|
49
|
+
wsUrl->toStdString(),
|
|
50
|
+
restUrl->toStdString(),
|
|
51
|
+
authToken->toStdString(),
|
|
52
|
+
reconnectIntervalMs,
|
|
53
|
+
maxReconnectAttempts,
|
|
54
|
+
batchSize,
|
|
55
|
+
syncIntervalMs
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
/**
|
|
61
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
62
|
+
*/
|
|
63
|
+
[[maybe_unused]]
|
|
64
|
+
static jni::local_ref<JConnectionConfig::javaobject> fromCpp(const ConnectionConfig& value) {
|
|
65
|
+
using JSignature = JConnectionConfig(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, double, double, double, double);
|
|
66
|
+
static const auto clazz = javaClassStatic();
|
|
67
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
68
|
+
return create(
|
|
69
|
+
clazz,
|
|
70
|
+
jni::make_jstring(value.wsUrl),
|
|
71
|
+
jni::make_jstring(value.restUrl),
|
|
72
|
+
jni::make_jstring(value.authToken),
|
|
73
|
+
value.reconnectIntervalMs,
|
|
74
|
+
value.maxReconnectAttempts,
|
|
75
|
+
value.batchSize,
|
|
76
|
+
value.syncIntervalMs
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
} // namespace margelo::nitro::nitrolocationtracking
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JConnectionState.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "ConnectionState.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::nitrolocationtracking {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "ConnectionState" and the the Kotlin enum "ConnectionState".
|
|
19
|
+
*/
|
|
20
|
+
struct JConnectionState final: public jni::JavaClass<JConnectionState> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/ConnectionState;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum ConnectionState.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
ConnectionState toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<ConnectionState>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JConnectionState> fromCpp(ConnectionState value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case ConnectionState::CONNECTED:
|
|
46
|
+
static const auto fieldCONNECTED = clazz->getStaticField<JConnectionState>("CONNECTED");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldCONNECTED);
|
|
48
|
+
case ConnectionState::DISCONNECTED:
|
|
49
|
+
static const auto fieldDISCONNECTED = clazz->getStaticField<JConnectionState>("DISCONNECTED");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldDISCONNECTED);
|
|
51
|
+
case ConnectionState::RECONNECTING:
|
|
52
|
+
static const auto fieldRECONNECTING = clazz->getStaticField<JConnectionState>("RECONNECTING");
|
|
53
|
+
return clazz->getStaticFieldValue(fieldRECONNECTING);
|
|
54
|
+
default:
|
|
55
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
56
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
} // namespace margelo::nitro::nitrolocationtracking
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_ConnectionState.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "ConnectionState.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JConnectionState.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::nitrolocationtracking {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents the Java/Kotlin callback `(state: ConnectionState) -> Unit`.
|
|
24
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
25
|
+
*/
|
|
26
|
+
struct JFunc_void_ConnectionState: public jni::JavaClass<JFunc_void_ConnectionState> {
|
|
27
|
+
public:
|
|
28
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/Func_void_ConnectionState;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Invokes the function this `JFunc_void_ConnectionState` instance holds through JNI.
|
|
33
|
+
*/
|
|
34
|
+
void invoke(ConnectionState state) const {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JConnectionState> /* state */)>("invoke");
|
|
36
|
+
method(self(), JConnectionState::fromCpp(state));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An implementation of Func_void_ConnectionState that is backed by a C++ implementation (using `std::function<...>`)
|
|
42
|
+
*/
|
|
43
|
+
class JFunc_void_ConnectionState_cxx final: public jni::HybridClass<JFunc_void_ConnectionState_cxx, JFunc_void_ConnectionState> {
|
|
44
|
+
public:
|
|
45
|
+
static jni::local_ref<JFunc_void_ConnectionState::javaobject> fromCpp(const std::function<void(ConnectionState /* state */)>& func) {
|
|
46
|
+
return JFunc_void_ConnectionState_cxx::newObjectCxxArgs(func);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_ConnectionState_cxx` instance holds.
|
|
52
|
+
*/
|
|
53
|
+
void invoke_cxx(jni::alias_ref<JConnectionState> state) {
|
|
54
|
+
_func(state->toCpp());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
[[nodiscard]]
|
|
59
|
+
inline const std::function<void(ConnectionState /* state */)>& getFunction() const {
|
|
60
|
+
return _func;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/Func_void_ConnectionState_cxx;";
|
|
65
|
+
static void registerNatives() {
|
|
66
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_ConnectionState_cxx::invoke_cxx)});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
explicit JFunc_void_ConnectionState_cxx(const std::function<void(ConnectionState /* state */)>& func): _func(func) { }
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
friend HybridBase;
|
|
74
|
+
std::function<void(ConnectionState /* state */)> _func;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::nitrolocationtracking
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_LocationData.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include "LocationData.hpp"
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
#include "JLocationData.hpp"
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::nitrolocationtracking {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents the Java/Kotlin callback `(location: LocationData) -> Unit`.
|
|
24
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
25
|
+
*/
|
|
26
|
+
struct JFunc_void_LocationData: public jni::JavaClass<JFunc_void_LocationData> {
|
|
27
|
+
public:
|
|
28
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/Func_void_LocationData;";
|
|
29
|
+
|
|
30
|
+
public:
|
|
31
|
+
/**
|
|
32
|
+
* Invokes the function this `JFunc_void_LocationData` instance holds through JNI.
|
|
33
|
+
*/
|
|
34
|
+
void invoke(const LocationData& location) const {
|
|
35
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JLocationData> /* location */)>("invoke");
|
|
36
|
+
method(self(), JLocationData::fromCpp(location));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An implementation of Func_void_LocationData that is backed by a C++ implementation (using `std::function<...>`)
|
|
42
|
+
*/
|
|
43
|
+
class JFunc_void_LocationData_cxx final: public jni::HybridClass<JFunc_void_LocationData_cxx, JFunc_void_LocationData> {
|
|
44
|
+
public:
|
|
45
|
+
static jni::local_ref<JFunc_void_LocationData::javaobject> fromCpp(const std::function<void(const LocationData& /* location */)>& func) {
|
|
46
|
+
return JFunc_void_LocationData_cxx::newObjectCxxArgs(func);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
/**
|
|
51
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_LocationData_cxx` instance holds.
|
|
52
|
+
*/
|
|
53
|
+
void invoke_cxx(jni::alias_ref<JLocationData> location) {
|
|
54
|
+
_func(location->toCpp());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public:
|
|
58
|
+
[[nodiscard]]
|
|
59
|
+
inline const std::function<void(const LocationData& /* location */)>& getFunction() const {
|
|
60
|
+
return _func;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public:
|
|
64
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/Func_void_LocationData_cxx;";
|
|
65
|
+
static void registerNatives() {
|
|
66
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_LocationData_cxx::invoke_cxx)});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private:
|
|
70
|
+
explicit JFunc_void_LocationData_cxx(const std::function<void(const LocationData& /* location */)>& func): _func(func) { }
|
|
71
|
+
|
|
72
|
+
private:
|
|
73
|
+
friend HybridBase;
|
|
74
|
+
std::function<void(const LocationData& /* location */)> _func;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
} // namespace margelo::nitro::nitrolocationtracking
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_bool.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include <functional>
|
|
14
|
+
#include <NitroModules/JNICallable.hpp>
|
|
15
|
+
|
|
16
|
+
namespace margelo::nitro::nitrolocationtracking {
|
|
17
|
+
|
|
18
|
+
using namespace facebook;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Represents the Java/Kotlin callback `(isMoving: Boolean) -> Unit`.
|
|
22
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
23
|
+
*/
|
|
24
|
+
struct JFunc_void_bool: public jni::JavaClass<JFunc_void_bool> {
|
|
25
|
+
public:
|
|
26
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/Func_void_bool;";
|
|
27
|
+
|
|
28
|
+
public:
|
|
29
|
+
/**
|
|
30
|
+
* Invokes the function this `JFunc_void_bool` instance holds through JNI.
|
|
31
|
+
*/
|
|
32
|
+
void invoke(bool isMoving) const {
|
|
33
|
+
static const auto method = javaClassStatic()->getMethod<void(jboolean /* isMoving */)>("invoke");
|
|
34
|
+
method(self(), isMoving);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* An implementation of Func_void_bool that is backed by a C++ implementation (using `std::function<...>`)
|
|
40
|
+
*/
|
|
41
|
+
class JFunc_void_bool_cxx final: public jni::HybridClass<JFunc_void_bool_cxx, JFunc_void_bool> {
|
|
42
|
+
public:
|
|
43
|
+
static jni::local_ref<JFunc_void_bool::javaobject> fromCpp(const std::function<void(bool /* isMoving */)>& func) {
|
|
44
|
+
return JFunc_void_bool_cxx::newObjectCxxArgs(func);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
/**
|
|
49
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_bool_cxx` instance holds.
|
|
50
|
+
*/
|
|
51
|
+
void invoke_cxx(jboolean isMoving) {
|
|
52
|
+
_func(static_cast<bool>(isMoving));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public:
|
|
56
|
+
[[nodiscard]]
|
|
57
|
+
inline const std::function<void(bool /* isMoving */)>& getFunction() const {
|
|
58
|
+
return _func;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public:
|
|
62
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/Func_void_bool_cxx;";
|
|
63
|
+
static void registerNatives() {
|
|
64
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_bool_cxx::invoke_cxx)});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private:
|
|
68
|
+
explicit JFunc_void_bool_cxx(const std::function<void(bool /* isMoving */)>& func): _func(func) { }
|
|
69
|
+
|
|
70
|
+
private:
|
|
71
|
+
friend HybridBase;
|
|
72
|
+
std::function<void(bool /* isMoving */)> _func;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
} // namespace margelo::nitro::nitrolocationtracking
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JFunc_void_std__string.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <functional>
|
|
12
|
+
|
|
13
|
+
#include <string>
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <NitroModules/JNICallable.hpp>
|
|
16
|
+
|
|
17
|
+
namespace margelo::nitro::nitrolocationtracking {
|
|
18
|
+
|
|
19
|
+
using namespace facebook;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Represents the Java/Kotlin callback `(message: String) -> Unit`.
|
|
23
|
+
* This can be passed around between C++ and Java/Kotlin.
|
|
24
|
+
*/
|
|
25
|
+
struct JFunc_void_std__string: public jni::JavaClass<JFunc_void_std__string> {
|
|
26
|
+
public:
|
|
27
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/Func_void_std__string;";
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/**
|
|
31
|
+
* Invokes the function this `JFunc_void_std__string` instance holds through JNI.
|
|
32
|
+
*/
|
|
33
|
+
void invoke(const std::string& message) const {
|
|
34
|
+
static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<jni::JString> /* message */)>("invoke");
|
|
35
|
+
method(self(), jni::make_jstring(message));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* An implementation of Func_void_std__string that is backed by a C++ implementation (using `std::function<...>`)
|
|
41
|
+
*/
|
|
42
|
+
class JFunc_void_std__string_cxx final: public jni::HybridClass<JFunc_void_std__string_cxx, JFunc_void_std__string> {
|
|
43
|
+
public:
|
|
44
|
+
static jni::local_ref<JFunc_void_std__string::javaobject> fromCpp(const std::function<void(const std::string& /* message */)>& func) {
|
|
45
|
+
return JFunc_void_std__string_cxx::newObjectCxxArgs(func);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
/**
|
|
50
|
+
* Invokes the C++ `std::function<...>` this `JFunc_void_std__string_cxx` instance holds.
|
|
51
|
+
*/
|
|
52
|
+
void invoke_cxx(jni::alias_ref<jni::JString> message) {
|
|
53
|
+
_func(message->toStdString());
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
[[nodiscard]]
|
|
58
|
+
inline const std::function<void(const std::string& /* message */)>& getFunction() const {
|
|
59
|
+
return _func;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public:
|
|
63
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/nitrolocationtracking/Func_void_std__string_cxx;";
|
|
64
|
+
static void registerNatives() {
|
|
65
|
+
registerHybrid({makeNativeMethod("invoke_cxx", JFunc_void_std__string_cxx::invoke_cxx)});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private:
|
|
69
|
+
explicit JFunc_void_std__string_cxx(const std::function<void(const std::string& /* message */)>& func): _func(func) { }
|
|
70
|
+
|
|
71
|
+
private:
|
|
72
|
+
friend HybridBase;
|
|
73
|
+
std::function<void(const std::string& /* message */)> _func;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro::nitrolocationtracking
|