react-native-radar 4.0.0 → 4.2.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/android/build.gradle +1 -1
- package/android/src/main/java/com/radar/RadarModuleImpl.java +110 -0
- package/android/src/newarch/java/com/radar/RadarModule.kt +45 -2
- package/android/src/oldarch/java/com/radar/RadarModule.java +56 -2
- package/dist/@types/RadarNativeInterface.d.ts +9 -2
- package/dist/@types/types.d.ts +47 -6
- package/dist/NativeRadar.d.ts +8 -1
- package/dist/index.native.js +35 -3
- package/dist/index.web.d.ts +6 -0
- package/dist/index.web.js +17 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/ios/RNRadar.mm +155 -3
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/Radar.h +108 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarBeacon.h +10 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarCoordinate.h +1 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarGeofence.h +10 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarInitializeOptions.h +0 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarSDK-Swift.h +101 -7
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarSDK.h +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarSDKFraudProtocol.h +26 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarSdkConfiguration.h +23 -28
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTrackingOptions.h +20 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTrip.h +15 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTripLeg.h +268 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTripOptions.h +6 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarTripOrder.h +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/RadarUser.h +2 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Info.plist +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios.abi.json +1702 -209
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Modules/module.modulemap +0 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/RadarSDK +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/Radar.h +108 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarBeacon.h +10 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarCoordinate.h +1 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarGeofence.h +10 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarInitializeOptions.h +0 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarSDK-Swift.h +204 -16
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarSDK.h +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarSDKFraudProtocol.h +26 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarSdkConfiguration.h +23 -28
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTrackingOptions.h +20 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTrip.h +15 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTripLeg.h +268 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTripOptions.h +6 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarTripOrder.h +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/RadarUser.h +2 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Info.plist +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1702 -209
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1702 -209
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/RadarSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +34 -9
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Modules/module.modulemap +0 -1
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/RadarSDK +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/_CodeSignature/CodeResources +71 -60
- package/ios/RadarSDKMotion.xcframework/ios-arm64/RadarSDKMotion.framework/Headers/RadarSDKMotion.h +0 -2
- package/ios/RadarSDKMotion.xcframework/ios-arm64/RadarSDKMotion.framework/Info.plist +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64/RadarSDKMotion.framework/RadarSDKMotion +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/Headers/RadarSDKMotion.h +0 -2
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/Info.plist +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/RadarSDKMotion +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RadarSDKMotion.xcframework/ios-arm64_x86_64-simulator/RadarSDKMotion.framework/_CodeSignature/CodeResources +3 -3
- package/package.json +2 -2
- package/src/@types/RadarNativeInterface.ts +11 -2
- package/src/@types/maplibre-react-native.d.ts +1 -14
- package/src/@types/types.ts +65 -7
- package/src/NativeRadar.ts +8 -1
- package/src/index.native.ts +42 -3
- package/src/index.web.js +17 -0
- package/src/version.ts +1 -1
- package/ios/RadarSDK.xcframework/ios-arm64/RadarSDK.framework/Headers/Radar-Swift.h +0 -7
- package/ios/RadarSDK.xcframework/ios-arm64_x86_64-simulator/RadarSDK.framework/Headers/Radar-Swift.h +0 -7
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
declare module "@maplibre/maplibre-react-native" {
|
|
2
|
-
export interface MapRef {
|
|
3
|
-
getCenter(): Promise<{ lng: number; lat: number }>;
|
|
4
|
-
getZoom(): Promise<number>;
|
|
5
|
-
getBearing(): Promise<number>;
|
|
6
|
-
getPitch(): Promise<number>;
|
|
7
|
-
getBounds(): Promise<{ ne: [number, number]; sw: [number, number] }>;
|
|
8
|
-
project(coordinate: [number, number]): Promise<{ x: number; y: number }>;
|
|
9
|
-
unproject(point: { x: number; y: number }): Promise<[number, number]>;
|
|
10
|
-
queryRenderedFeatures(
|
|
11
|
-
point: [number, number] | [[number, number], [number, number]],
|
|
12
|
-
filter?: string[],
|
|
13
|
-
layerIDs?: string[],
|
|
14
|
-
): Promise<GeoJSON.FeatureCollection>;
|
|
15
|
-
}
|
|
2
|
+
export interface MapRef {}
|
|
16
3
|
}
|
package/src/@types/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Platform } from "react-native";
|
|
2
|
+
import { Platform, type NativeSyntheticEvent } from "react-native";
|
|
3
3
|
import type { MapRef } from "@maplibre/maplibre-react-native";
|
|
4
4
|
const platform = Platform.OS;
|
|
5
5
|
|
|
@@ -31,7 +31,7 @@ export interface RadarTrackingOptions {
|
|
|
31
31
|
desiredAccuracy: RadarTrackingOptionsDesiredAccuracy;
|
|
32
32
|
stopDuration: number;
|
|
33
33
|
stopDistance: number;
|
|
34
|
-
sync: "all" | "stopsAndExits" | "none";
|
|
34
|
+
sync: "all" | "stopsAndExits" | "none" | "events";
|
|
35
35
|
replay: "all" | "stops" | "none";
|
|
36
36
|
useStoppedGeofence: boolean;
|
|
37
37
|
showBlueBar?: boolean;
|
|
@@ -316,6 +316,7 @@ export interface RadarTripOptions {
|
|
|
316
316
|
scheduledArrivalAt?: number;
|
|
317
317
|
approachingThreshold?: number;
|
|
318
318
|
startTracking?: boolean; // defaults to true
|
|
319
|
+
legs?: RadarTripLeg[];
|
|
319
320
|
}
|
|
320
321
|
|
|
321
322
|
export interface RadarTrackCallback {
|
|
@@ -578,6 +579,59 @@ export interface RadarTrip {
|
|
|
578
579
|
scheduledArrivalAt?: Date;
|
|
579
580
|
destinationLocation: Location;
|
|
580
581
|
delay: RadarDelay;
|
|
582
|
+
legs?: RadarTripLeg[];
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export type RadarTripLegStatus =
|
|
586
|
+
| "unknown"
|
|
587
|
+
| "pending"
|
|
588
|
+
| "started"
|
|
589
|
+
| "approaching"
|
|
590
|
+
| "arrived"
|
|
591
|
+
| "completed"
|
|
592
|
+
| "canceled"
|
|
593
|
+
| "expired";
|
|
594
|
+
|
|
595
|
+
export type RadarTripLegDestinationType =
|
|
596
|
+
| "unknown"
|
|
597
|
+
| "geofence"
|
|
598
|
+
| "address"
|
|
599
|
+
| "coordinates";
|
|
600
|
+
|
|
601
|
+
export interface RadarTripLeg {
|
|
602
|
+
_id?: string;
|
|
603
|
+
status?: RadarTripLegStatus;
|
|
604
|
+
destinationType?: RadarTripLegDestinationType;
|
|
605
|
+
createdAt?: string;
|
|
606
|
+
updatedAt?: string;
|
|
607
|
+
etaDuration?: number;
|
|
608
|
+
etaDistance?: number;
|
|
609
|
+
destinationGeofenceTag?: string;
|
|
610
|
+
destinationGeofenceExternalId?: string;
|
|
611
|
+
destinationGeofenceId?: string;
|
|
612
|
+
address?: string;
|
|
613
|
+
coordinates?: Location;
|
|
614
|
+
arrivalRadius?: number;
|
|
615
|
+
stopDuration?: number;
|
|
616
|
+
metadata?: RadarMetadata;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export interface RadarUpdateTripLegOptions {
|
|
620
|
+
tripId?: string;
|
|
621
|
+
legId: string;
|
|
622
|
+
status: RadarTripLegStatus;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
export interface RadarReorderTripLegsOptions {
|
|
626
|
+
tripId?: string;
|
|
627
|
+
legIds: string[];
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
export interface RadarTripLegCallback {
|
|
631
|
+
status: string;
|
|
632
|
+
trip?: RadarTrip;
|
|
633
|
+
leg?: RadarTripLeg;
|
|
634
|
+
events?: RadarEvent[];
|
|
581
635
|
}
|
|
582
636
|
|
|
583
637
|
export interface RadarDelay {
|
|
@@ -823,7 +877,7 @@ export interface RadarFraud {
|
|
|
823
877
|
|
|
824
878
|
export type RadarTrackingOptionsReplay = "all" | "stops" | "none";
|
|
825
879
|
|
|
826
|
-
export type RadarTrackingOptionsSync = "none" | "stopsAndExits" | "all";
|
|
880
|
+
export type RadarTrackingOptionsSync = "none" | "stopsAndExits" | "all" | "events";
|
|
827
881
|
|
|
828
882
|
export type RadarRouteMode = "foot" | "bike" | "car" | "truck" | "motorbike";
|
|
829
883
|
|
|
@@ -854,15 +908,19 @@ export interface RadarMapOptions {
|
|
|
854
908
|
showUserLocation?: boolean;
|
|
855
909
|
mapRef?: React.Ref<MapRef>;
|
|
856
910
|
onRegionDidChange?: (event: RadarMapRegionChangeEvent) => void;
|
|
857
|
-
onDidFinishLoadingMap?: () => void;
|
|
858
|
-
onWillStartLoadingMap?: () => void;
|
|
859
|
-
onDidFailLoadingMap?: () => void;
|
|
911
|
+
onDidFinishLoadingMap?: (event: NativeSyntheticEvent<null>) => void;
|
|
912
|
+
onWillStartLoadingMap?: (event: NativeSyntheticEvent<null>) => void;
|
|
913
|
+
onDidFailLoadingMap?: (event: NativeSyntheticEvent<null>) => void;
|
|
860
914
|
}
|
|
861
915
|
|
|
862
916
|
export interface RadarMapRegionChangeEvent {
|
|
863
917
|
center: [number, number];
|
|
864
918
|
zoom: number;
|
|
865
|
-
|
|
919
|
+
/**
|
|
920
|
+
* Geographic bounds in `[west, south, east, north]` order (south-west corner
|
|
921
|
+
* then north-east corner, per GeoJSON RFC 7946).
|
|
922
|
+
*/
|
|
923
|
+
bounds?: [west: number, south: number, east: number, north: number];
|
|
866
924
|
bearing?: number;
|
|
867
925
|
pitch?: number;
|
|
868
926
|
animated: boolean;
|
package/src/NativeRadar.ts
CHANGED
|
@@ -43,7 +43,8 @@ export type InAppMessageClickedEmitter = {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
export interface Spec extends TurboModule {
|
|
46
|
-
initialize(publishableKey: string, fraud: boolean): void;
|
|
46
|
+
initialize(publishableKey: string, fraud: boolean, options: Object | null): void;
|
|
47
|
+
initializeWithAuthToken(authToken: string, fraud: boolean, options: Object | null): void;
|
|
47
48
|
requestPermissions(background: boolean): Promise<string>;
|
|
48
49
|
getPermissionsStatus(): Promise<string>;
|
|
49
50
|
trackOnce(trackOnceOptions: Object | null): Promise<Object>;
|
|
@@ -84,6 +85,8 @@ export interface Spec extends TurboModule {
|
|
|
84
85
|
completeTrip(): Promise<Object>;
|
|
85
86
|
cancelTrip(): Promise<Object>;
|
|
86
87
|
updateTrip(options: Object): Promise<Object>;
|
|
88
|
+
updateTripLeg(options: Object): Promise<Object>;
|
|
89
|
+
reorderTripLegs(options: Object): Promise<Object>;
|
|
87
90
|
acceptEvent(eventId: string, verifiedPlaceId: string): void;
|
|
88
91
|
rejectEvent(eventId: string): void;
|
|
89
92
|
getContext(location: Object | null): Promise<Object>;
|
|
@@ -101,6 +104,10 @@ export interface Spec extends TurboModule {
|
|
|
101
104
|
getHost(): Promise<string>;
|
|
102
105
|
getPublishableKey(): Promise<string>;
|
|
103
106
|
showInAppMessage(inAppMessage: Object): void;
|
|
107
|
+
setPushNotificationToken(token: string): void;
|
|
108
|
+
isInitialized(): Promise<boolean>;
|
|
109
|
+
setAppGroup(groupId: string): void;
|
|
110
|
+
setLocationExtensionToken(token: string): void;
|
|
104
111
|
readonly locationEmitter: EventEmitter<LocationEmitter>;
|
|
105
112
|
readonly clientLocationEmitter: EventEmitter<ClientLocationEmitter>;
|
|
106
113
|
readonly errorEmitter: EventEmitter<ErrorEmitter>;
|
package/src/index.native.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EventSubscription } from "react-native";
|
|
2
|
+
import { Platform } from "react-native";
|
|
2
3
|
import type { RadarNativeInterface } from "./@types/RadarNativeInterface";
|
|
3
4
|
import type {
|
|
4
5
|
RadarTrackCallback,
|
|
@@ -51,6 +52,9 @@ import type {
|
|
|
51
52
|
RadarInAppMessageDismissedCallback,
|
|
52
53
|
RadarInAppMessageClickedCallback,
|
|
53
54
|
RadarInAppMessage,
|
|
55
|
+
RadarUpdateTripLegOptions,
|
|
56
|
+
RadarReorderTripLegsOptions,
|
|
57
|
+
RadarTripLegCallback,
|
|
54
58
|
} from "./@types/types";
|
|
55
59
|
import { NativeEventEmitter, NativeModules } from "react-native";
|
|
56
60
|
import { VERSION } from "./version";
|
|
@@ -118,8 +122,16 @@ let inAppMessageDismissedUpdateSubscription: EventSubscription | null = null;
|
|
|
118
122
|
let inAppMessageClickedUpdateSubscription: EventSubscription | null = null;
|
|
119
123
|
|
|
120
124
|
const Radar: RadarNativeInterface = {
|
|
121
|
-
initialize: (publishableKey: string, fraud?: boolean) => {
|
|
122
|
-
NativeRadar.initialize(publishableKey, !!fraud);
|
|
125
|
+
initialize: (publishableKey: string, fraud?: boolean, options?: Object | null) => {
|
|
126
|
+
NativeRadar.initialize(publishableKey, !!fraud, options || null);
|
|
127
|
+
Radar.onNewInAppMessage((inAppMessage) => {
|
|
128
|
+
Radar.showInAppMessage(inAppMessage);
|
|
129
|
+
});
|
|
130
|
+
return;
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
initializeWithAuthToken: (authToken: string, fraud?: boolean, options?: Object | null) => {
|
|
134
|
+
NativeRadar.initializeWithAuthToken(authToken, !!fraud, options || null);
|
|
123
135
|
Radar.onNewInAppMessage((inAppMessage) => {
|
|
124
136
|
Radar.showInAppMessage(inAppMessage);
|
|
125
137
|
});
|
|
@@ -316,7 +328,21 @@ const Radar: RadarNativeInterface = {
|
|
|
316
328
|
showInAppMessage: (inAppMessage: RadarInAppMessage) => {
|
|
317
329
|
return NativeRadar.showInAppMessage(inAppMessage);
|
|
318
330
|
},
|
|
319
|
-
|
|
331
|
+
setPushNotificationToken: (token: string) => {
|
|
332
|
+
if (Platform.OS === "android") {
|
|
333
|
+
return NativeRadar.setPushNotificationToken(token);
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
setAppGroup: (groupId: string) => {
|
|
337
|
+
if (Platform.OS === "ios") {
|
|
338
|
+
return NativeRadar.setAppGroup(groupId);
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
setLocationExtensionToken: (token: string) => {
|
|
342
|
+
if (Platform.OS === "ios") {
|
|
343
|
+
return NativeRadar.setLocationExtensionToken(token);
|
|
344
|
+
}
|
|
345
|
+
},
|
|
320
346
|
requestPermissions: (background: boolean) => {
|
|
321
347
|
return NativeRadar.requestPermissions(
|
|
322
348
|
background
|
|
@@ -452,6 +478,16 @@ const Radar: RadarNativeInterface = {
|
|
|
452
478
|
): Promise<RadarTripCallback> {
|
|
453
479
|
return NativeRadar.updateTrip(options) as Promise<RadarTripCallback>;
|
|
454
480
|
},
|
|
481
|
+
updateTripLeg: function (
|
|
482
|
+
options: RadarUpdateTripLegOptions
|
|
483
|
+
): Promise<RadarTripLegCallback> {
|
|
484
|
+
return NativeRadar.updateTripLeg(options) as Promise<RadarTripLegCallback>;
|
|
485
|
+
},
|
|
486
|
+
reorderTripLegs: function (
|
|
487
|
+
options: RadarReorderTripLegsOptions
|
|
488
|
+
): Promise<RadarTripCallback> {
|
|
489
|
+
return NativeRadar.reorderTripLegs(options) as Promise<RadarTripCallback>;
|
|
490
|
+
},
|
|
455
491
|
acceptEvent: function (eventId: string, verifiedPlaceId: string): void {
|
|
456
492
|
return NativeRadar.acceptEvent(eventId, verifiedPlaceId);
|
|
457
493
|
},
|
|
@@ -534,6 +570,9 @@ const Radar: RadarNativeInterface = {
|
|
|
534
570
|
getPublishableKey: function (): Promise<string> {
|
|
535
571
|
return NativeRadar.getPublishableKey();
|
|
536
572
|
},
|
|
573
|
+
isInitialized: function (): Promise<boolean> {
|
|
574
|
+
return NativeRadar.isInitialized();
|
|
575
|
+
},
|
|
537
576
|
};
|
|
538
577
|
|
|
539
578
|
export default Radar;
|
package/src/index.web.js
CHANGED
|
@@ -10,6 +10,10 @@ const initialize = (publishableKey) => {
|
|
|
10
10
|
RadarJS.initialize(publishableKey);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
const initializeWithAuthToken = (authToken) => {
|
|
14
|
+
if (throws) throw new Error("initializeWithAuthToken() is not implemented on web");
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
const setLogLevel = (level) => {
|
|
14
18
|
if (throws) throw new Error("setLogLevel() is not implemented on web");
|
|
15
19
|
};
|
|
@@ -259,6 +263,16 @@ const updateTrip = (tripOptions) => {
|
|
|
259
263
|
});
|
|
260
264
|
};
|
|
261
265
|
|
|
266
|
+
const updateTripLeg = (options) => {
|
|
267
|
+
if (throws) throw new Error("updateTripLeg() is not implemented on web");
|
|
268
|
+
return new Promise((resolve, reject) => { reject("updateTripLeg() is not implemented on web") });
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const reorderTripLegs = (options) => {
|
|
272
|
+
if (throws) throw new Error("reorderTripLegs() is not implemented on web");
|
|
273
|
+
return new Promise((resolve, reject) => { reject("reorderTripLegs() is not implemented on web") });
|
|
274
|
+
}
|
|
275
|
+
|
|
262
276
|
const acceptEvent = (eventId, verifiedPlaceId) => {
|
|
263
277
|
if (throws) throw new Error("acceptEvent() is not implemented on web");
|
|
264
278
|
};
|
|
@@ -467,6 +481,7 @@ const rnSdkVersion = () => VERSION;
|
|
|
467
481
|
|
|
468
482
|
const Radar = {
|
|
469
483
|
initialize,
|
|
484
|
+
initializeWithAuthToken,
|
|
470
485
|
setLogLevel,
|
|
471
486
|
setUserId,
|
|
472
487
|
getUserId,
|
|
@@ -499,6 +514,8 @@ const Radar = {
|
|
|
499
514
|
completeTrip,
|
|
500
515
|
cancelTrip,
|
|
501
516
|
updateTrip,
|
|
517
|
+
updateTripLeg,
|
|
518
|
+
reorderTripLegs,
|
|
502
519
|
acceptEvent,
|
|
503
520
|
rejectEvent,
|
|
504
521
|
getContext,
|
package/src/version.ts
CHANGED