react-native-radar 3.9.1 → 3.10.0-beta.2
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/dist/package.json +80 -0
- package/dist/src/@types/RadarNativeInterface.d.ts +51 -0
- package/dist/src/@types/RadarNativeInterface.js +2 -0
- package/dist/src/@types/types.d.ts +425 -0
- package/dist/src/@types/types.js +16 -0
- package/dist/src/helpers.d.ts +2 -0
- package/dist/src/helpers.js +11 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.js +37 -0
- package/dist/src/index.native.d.ts +3 -0
- package/dist/src/index.native.js +137 -0
- package/dist/src/index.web.d.ts +73 -0
- package/dist/src/index.web.js +385 -0
- package/dist/src/ui/autocomplete.d.ts +4 -0
- package/dist/src/ui/autocomplete.js +213 -0
- package/dist/src/ui/images.d.ts +5 -0
- package/dist/src/ui/images.js +8 -0
- package/dist/src/ui/map.d.ts +5 -0
- package/dist/src/ui/map.js +112 -0
- package/dist/src/ui/styles.d.ts +2 -0
- package/dist/src/ui/styles.js +125 -0
- package/package.json +15 -8
- package/src/@types/RadarNativeInterface.ts +98 -0
- package/src/@types/types.ts +547 -0
- package/src/index.native.ts +275 -0
- package/src/index.ts +21 -0
- package/{js → src}/index.web.js +1 -1
- package/{js → src}/ui/autocomplete.jsx +3 -3
- package/src/ui/back.png +0 -0
- package/src/ui/close.png +0 -0
- package/src/ui/map-logo.png +0 -0
- package/src/ui/marker.png +0 -0
- package/src/ui/radar-logo.png +0 -0
- package/src/ui/search.png +0 -0
- package/js/index.js +0 -12
- package/js/index.native.js +0 -263
- /package/{js → dist/src}/ui/back.png +0 -0
- /package/{js → dist/src}/ui/close.png +0 -0
- /package/{js → dist/src}/ui/map-logo.png +0 -0
- /package/{js → dist/src}/ui/marker.png +0 -0
- /package/{js → dist/src}/ui/radar-logo.png +0 -0
- /package/{js → dist/src}/ui/search.png +0 -0
- /package/{js → src}/helpers.js +0 -0
- /package/{js → src}/ui/images.js +0 -0
- /package/{js → src}/ui/map.jsx +0 -0
- /package/{js → src}/ui/styles.js +0 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { NativeEventEmitter, NativeModules, Platform } from "react-native";
|
|
2
|
+
import { version } from "../package.json";
|
|
3
|
+
import { RadarNativeInterface } from "./@types/RadarNativeInterface";
|
|
4
|
+
import {
|
|
5
|
+
Location,
|
|
6
|
+
RadarAutocompleteOptions,
|
|
7
|
+
RadarContextCallback,
|
|
8
|
+
RadarGeocodeCallback,
|
|
9
|
+
RadarGetDistanceOptions,
|
|
10
|
+
RadarLocationCallback,
|
|
11
|
+
RadarLogConversionCallback,
|
|
12
|
+
RadarLogConversionOptions,
|
|
13
|
+
RadarLogLevel,
|
|
14
|
+
RadarMockTrackingOptions,
|
|
15
|
+
RadarNotificationOptions,
|
|
16
|
+
RadarPermissionsStatus,
|
|
17
|
+
RadarRouteCallback,
|
|
18
|
+
RadarRouteMatrix,
|
|
19
|
+
RadarSearchGeofencesCallback,
|
|
20
|
+
RadarSearchGeofencesOptions,
|
|
21
|
+
RadarSearchPlacesCallback,
|
|
22
|
+
RadarSearchPlacesOptions,
|
|
23
|
+
RadarStartTripOptions,
|
|
24
|
+
RadarTrackCallback,
|
|
25
|
+
RadarTrackOnceOptions,
|
|
26
|
+
RadarTrackTokenCallback,
|
|
27
|
+
RadarTrackingOptions,
|
|
28
|
+
RadarTrackingOptionsDesiredAccuracy,
|
|
29
|
+
RadarTrackingOptionsForegroundService,
|
|
30
|
+
RadarTripCallback,
|
|
31
|
+
RadarTripOptions,
|
|
32
|
+
RadarUpdateTripOptions,
|
|
33
|
+
Event,
|
|
34
|
+
RadarListenerCallback,
|
|
35
|
+
RadarGetMatrixOptions,
|
|
36
|
+
} from "./@types/types";
|
|
37
|
+
|
|
38
|
+
if (
|
|
39
|
+
!NativeModules.RNRadar &&
|
|
40
|
+
(Platform.OS === "ios" || Platform.OS === "android")
|
|
41
|
+
) {
|
|
42
|
+
throw new Error("NativeModules.RNRadar is undefined");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const eventEmitter = new NativeEventEmitter(NativeModules.RNRadar);
|
|
46
|
+
const initialize = (publishableKey: string, fraud: boolean = false): void => {
|
|
47
|
+
NativeModules.RNRadar.initialize(publishableKey, fraud);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const setLogLevel = (level: RadarLogLevel): void => {
|
|
51
|
+
NativeModules.RNRadar.setLogLevel(level);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const setUserId = (userId: string): void => {
|
|
55
|
+
NativeModules.RNRadar.setUserId(userId);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const getUserId = (): Promise<string> => NativeModules.RNRadar.getUserId();
|
|
59
|
+
|
|
60
|
+
const setDescription = (description: string): void => {
|
|
61
|
+
NativeModules.RNRadar.setDescription(description);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const getDescription = (): Promise<string> =>
|
|
65
|
+
NativeModules.RNRadar.getDescription();
|
|
66
|
+
|
|
67
|
+
const setMetadata = (metadata: object): void => {
|
|
68
|
+
NativeModules.RNRadar.setMetadata(metadata);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const getMetadata = (): Promise<object> => NativeModules.RNRadar.getMetadata();
|
|
72
|
+
|
|
73
|
+
const setAnonymousTrackingEnabled = (enabled: boolean): void =>
|
|
74
|
+
NativeModules.RNRadar.setAnonymousTrackingEnabled(enabled);
|
|
75
|
+
|
|
76
|
+
const getPermissionsStatus = (): Promise<RadarPermissionsStatus> =>
|
|
77
|
+
NativeModules.RNRadar.getPermissionsStatus();
|
|
78
|
+
|
|
79
|
+
const requestPermissions = (
|
|
80
|
+
background: boolean
|
|
81
|
+
): Promise<RadarPermissionsStatus> =>
|
|
82
|
+
NativeModules.RNRadar.requestPermissions(background);
|
|
83
|
+
|
|
84
|
+
const getLocation = (
|
|
85
|
+
desiredAccuracy?: RadarTrackingOptionsDesiredAccuracy
|
|
86
|
+
): Promise<RadarLocationCallback> =>
|
|
87
|
+
NativeModules.RNRadar.getLocation(desiredAccuracy);
|
|
88
|
+
|
|
89
|
+
const trackOnce = (
|
|
90
|
+
options?: RadarTrackOnceOptions | Location
|
|
91
|
+
): Promise<RadarTrackCallback> => {
|
|
92
|
+
let backCompatibleOptions = options;
|
|
93
|
+
if (options && "latitude" in options) {
|
|
94
|
+
backCompatibleOptions = {
|
|
95
|
+
location: {
|
|
96
|
+
...options,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return NativeModules.RNRadar.trackOnce(backCompatibleOptions);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const trackVerified = (): Promise<RadarTrackCallback> =>
|
|
104
|
+
NativeModules.RNRadar.trackVerified();
|
|
105
|
+
|
|
106
|
+
const trackVerifiedToken = (): Promise<RadarTrackTokenCallback> =>
|
|
107
|
+
NativeModules.RNRadar.trackVerifiedToken();
|
|
108
|
+
|
|
109
|
+
const startTrackingEfficient = (): void =>
|
|
110
|
+
NativeModules.RNRadar.startTrackingEfficient();
|
|
111
|
+
|
|
112
|
+
const startTrackingResponsive = (): void =>
|
|
113
|
+
NativeModules.RNRadar.startTrackingResponsive();
|
|
114
|
+
|
|
115
|
+
const startTrackingContinuous = (): void =>
|
|
116
|
+
NativeModules.RNRadar.startTrackingContinuous();
|
|
117
|
+
|
|
118
|
+
const startTrackingCustom = (options: RadarTrackingOptions): void =>
|
|
119
|
+
NativeModules.RNRadar.startTrackingCustom(options);
|
|
120
|
+
|
|
121
|
+
const mockTracking = (options: RadarMockTrackingOptions): void =>
|
|
122
|
+
NativeModules.RNRadar.mockTracking(options);
|
|
123
|
+
|
|
124
|
+
const stopTracking = (): void => NativeModules.RNRadar.stopTracking();
|
|
125
|
+
|
|
126
|
+
const getTrackingOptions = (): Promise<RadarTrackingOptions> =>
|
|
127
|
+
NativeModules.RNRadar.getTrackingOptions();
|
|
128
|
+
|
|
129
|
+
const isUsingRemoteTrackingOptions = (): Promise<boolean> =>
|
|
130
|
+
NativeModules.RNRadar.isUsingRemoteTrackingOptions();
|
|
131
|
+
|
|
132
|
+
const isTracking = (): boolean => NativeModules.RNRadar.isTracking();
|
|
133
|
+
|
|
134
|
+
const setForegroundServiceOptions = (
|
|
135
|
+
options: RadarTrackingOptionsForegroundService
|
|
136
|
+
): void => NativeModules.RNRadar.setForegroundServiceOptions(options);
|
|
137
|
+
|
|
138
|
+
const setNotificationOptions = (options: RadarNotificationOptions): void =>
|
|
139
|
+
NativeModules.RNRadar.setNotificationOptions(options);
|
|
140
|
+
|
|
141
|
+
// Take a closer look?
|
|
142
|
+
const getTripOptions = (): Promise<RadarTripOptions> =>
|
|
143
|
+
NativeModules.RNRadar.getTripOptions();
|
|
144
|
+
|
|
145
|
+
const startTrip = (
|
|
146
|
+
options: RadarStartTripOptions
|
|
147
|
+
): Promise<RadarTripCallback> => NativeModules.RNRadar.startTrip(options);
|
|
148
|
+
|
|
149
|
+
const completeTrip = (): Promise<RadarTripCallback> =>
|
|
150
|
+
NativeModules.RNRadar.completeTrip();
|
|
151
|
+
|
|
152
|
+
const cancelTrip = (): Promise<RadarTripCallback> =>
|
|
153
|
+
NativeModules.RNRadar.cancelTrip();
|
|
154
|
+
|
|
155
|
+
const updateTrip = (
|
|
156
|
+
options: RadarUpdateTripOptions
|
|
157
|
+
): Promise<RadarTripCallback> => NativeModules.RNRadar.updateTrip(options);
|
|
158
|
+
|
|
159
|
+
const acceptEvent = (eventId: string, verifiedPlaceId: string): void =>
|
|
160
|
+
NativeModules.RNRadar.acceptEvent(eventId, verifiedPlaceId);
|
|
161
|
+
|
|
162
|
+
const rejectEvent = (eventId: string): void =>
|
|
163
|
+
NativeModules.RNRadar.rejectEvent(eventId);
|
|
164
|
+
|
|
165
|
+
const getContext = (location?: Location): Promise<RadarContextCallback> =>
|
|
166
|
+
NativeModules.RNRadar.getContext(location);
|
|
167
|
+
|
|
168
|
+
const searchPlaces = (
|
|
169
|
+
options: RadarSearchPlacesOptions
|
|
170
|
+
): Promise<RadarSearchPlacesCallback> =>
|
|
171
|
+
NativeModules.RNRadar.searchPlaces(options);
|
|
172
|
+
|
|
173
|
+
const searchGeofences = (
|
|
174
|
+
options: RadarSearchGeofencesOptions
|
|
175
|
+
): Promise<RadarSearchGeofencesCallback> =>
|
|
176
|
+
NativeModules.RNRadar.searchGeofences(options);
|
|
177
|
+
|
|
178
|
+
const autocomplete = (
|
|
179
|
+
options: RadarAutocompleteOptions
|
|
180
|
+
): Promise<RadarGeocodeCallback> => NativeModules.RNRadar.autocomplete(options);
|
|
181
|
+
|
|
182
|
+
const geocode = (address: string): Promise<RadarGeocodeCallback> =>
|
|
183
|
+
NativeModules.RNRadar.geocode(address);
|
|
184
|
+
|
|
185
|
+
const reverseGeocode = (location: Location): Promise<RadarGeocodeCallback> =>
|
|
186
|
+
NativeModules.RNRadar.reverseGeocode(location);
|
|
187
|
+
|
|
188
|
+
const ipGeocode = (): Promise<RadarGeocodeCallback> =>
|
|
189
|
+
NativeModules.RNRadar.ipGeocode();
|
|
190
|
+
|
|
191
|
+
const getDistance = (
|
|
192
|
+
options: RadarGetDistanceOptions
|
|
193
|
+
): Promise<RadarRouteCallback> => NativeModules.RNRadar.getDistance(options);
|
|
194
|
+
|
|
195
|
+
const getMatrix = (
|
|
196
|
+
options: RadarGetMatrixOptions
|
|
197
|
+
): Promise<RadarRouteMatrix> => NativeModules.RNRadar.getMatrix(options);
|
|
198
|
+
|
|
199
|
+
const logConversion = (
|
|
200
|
+
options: RadarLogConversionOptions
|
|
201
|
+
): Promise<RadarLogConversionCallback> =>
|
|
202
|
+
NativeModules.RNRadar.logConversion(options);
|
|
203
|
+
|
|
204
|
+
const sendEvent = (name: string, metadata: object): void =>
|
|
205
|
+
NativeModules.RNRadar.sendEvent(name, metadata);
|
|
206
|
+
|
|
207
|
+
const on = (event: Event, callback: RadarListenerCallback): void =>
|
|
208
|
+
eventEmitter.addListener(event, callback);
|
|
209
|
+
|
|
210
|
+
const off = (event: Event, callback: Function | undefined): void => {
|
|
211
|
+
if (callback) {
|
|
212
|
+
// @ts-ignore
|
|
213
|
+
eventEmitter.removeListener(event, callback);
|
|
214
|
+
} else {
|
|
215
|
+
eventEmitter.removeAllListeners(event);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
const nativeSdkVersion = (): Promise<string> =>
|
|
220
|
+
NativeModules.RNRadar.nativeSdkVersion();
|
|
221
|
+
|
|
222
|
+
const rnSdkVersion = (): string => version;
|
|
223
|
+
|
|
224
|
+
const Radar: RadarNativeInterface = {
|
|
225
|
+
initialize,
|
|
226
|
+
setLogLevel,
|
|
227
|
+
setUserId,
|
|
228
|
+
getUserId,
|
|
229
|
+
setDescription,
|
|
230
|
+
getDescription,
|
|
231
|
+
setMetadata,
|
|
232
|
+
getMetadata,
|
|
233
|
+
setAnonymousTrackingEnabled,
|
|
234
|
+
isUsingRemoteTrackingOptions,
|
|
235
|
+
getPermissionsStatus,
|
|
236
|
+
requestPermissions,
|
|
237
|
+
getLocation,
|
|
238
|
+
trackOnce,
|
|
239
|
+
trackVerified,
|
|
240
|
+
trackVerifiedToken,
|
|
241
|
+
startTrackingEfficient,
|
|
242
|
+
startTrackingResponsive,
|
|
243
|
+
startTrackingContinuous,
|
|
244
|
+
startTrackingCustom,
|
|
245
|
+
mockTracking,
|
|
246
|
+
stopTracking,
|
|
247
|
+
isTracking,
|
|
248
|
+
getTrackingOptions,
|
|
249
|
+
setForegroundServiceOptions,
|
|
250
|
+
setNotificationOptions,
|
|
251
|
+
acceptEvent,
|
|
252
|
+
rejectEvent,
|
|
253
|
+
getTripOptions,
|
|
254
|
+
startTrip,
|
|
255
|
+
updateTrip,
|
|
256
|
+
completeTrip,
|
|
257
|
+
cancelTrip,
|
|
258
|
+
getContext,
|
|
259
|
+
searchPlaces,
|
|
260
|
+
searchGeofences,
|
|
261
|
+
autocomplete,
|
|
262
|
+
geocode,
|
|
263
|
+
reverseGeocode,
|
|
264
|
+
ipGeocode,
|
|
265
|
+
getDistance,
|
|
266
|
+
getMatrix,
|
|
267
|
+
logConversion,
|
|
268
|
+
sendEvent,
|
|
269
|
+
on,
|
|
270
|
+
off,
|
|
271
|
+
nativeSdkVersion,
|
|
272
|
+
rnSdkVersion,
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
export default Radar;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//import { Platform } from "react-native";
|
|
2
|
+
import { RadarNativeInterface } from "./@types/RadarNativeInterface";
|
|
3
|
+
|
|
4
|
+
//type RadarInterface = Platform["OS"] extends "web" ? RadarNativeInterface : any;
|
|
5
|
+
//type RadarInterface = RadarNativeInterface;
|
|
6
|
+
|
|
7
|
+
let module: RadarNativeInterface;
|
|
8
|
+
// if (Platform.OS === "web") {
|
|
9
|
+
// module = require("./index.web").default;
|
|
10
|
+
// } else {
|
|
11
|
+
module = require("./index.native").default;
|
|
12
|
+
//}
|
|
13
|
+
export default module;
|
|
14
|
+
|
|
15
|
+
export { default as RadarRNWeb } from "./index.web";
|
|
16
|
+
export { default as Autocomplete } from "./ui/autocomplete";
|
|
17
|
+
export { default as Map } from "./ui/map";
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export * from "./@types/types";
|
|
21
|
+
export * from "./@types/RadarNativeInterface";
|
package/{js → src}/index.web.js
RENAMED
|
@@ -29,7 +29,7 @@ import { default as defaultStyles } from './styles';
|
|
|
29
29
|
|
|
30
30
|
const defaultAutocompleteOptions = {
|
|
31
31
|
debounceMS: 200, // Debounce time in milliseconds
|
|
32
|
-
|
|
32
|
+
minCharacters: 3, // Minimum number of characters to trigger autocomplete
|
|
33
33
|
limit: 8, // Maximum number of results to return
|
|
34
34
|
placeholder: "Search address", // Placeholder text for the input field
|
|
35
35
|
showMarkers: true,
|
|
@@ -50,7 +50,7 @@ const autocompleteUI = ({ options = {} }) => {
|
|
|
50
50
|
|
|
51
51
|
const fetchResults = useCallback(
|
|
52
52
|
async (searchQuery) => {
|
|
53
|
-
if (searchQuery.length < config.
|
|
53
|
+
if (searchQuery.length < config.minCharacters) return;
|
|
54
54
|
|
|
55
55
|
const { limit, layers, countryCode } = config;
|
|
56
56
|
const params = { query: searchQuery, limit, layers, countryCode };
|
|
@@ -86,7 +86,7 @@ const autocompleteUI = ({ options = {} }) => {
|
|
|
86
86
|
clearTimeout(timerRef.current);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
if (text.length < config.
|
|
89
|
+
if (text.length < config.minCharacters) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
|
package/src/ui/back.png
ADDED
|
Binary file
|
package/src/ui/close.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/js/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
let module = {};
|
|
4
|
-
if (Platform.OS === 'web') {
|
|
5
|
-
module = require('./index.web').default;
|
|
6
|
-
} else {
|
|
7
|
-
module = require('./index.native').default;
|
|
8
|
-
}
|
|
9
|
-
export default module;
|
|
10
|
-
|
|
11
|
-
export { default as Autocomplete } from './ui/autocomplete';
|
|
12
|
-
export { default as Map } from './ui/map';
|
package/js/index.native.js
DELETED
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
|
|
2
|
-
import { version } from '../package.json'
|
|
3
|
-
|
|
4
|
-
if (!NativeModules.RNRadar && (Platform.OS === 'ios' || Platform.OS === 'android')) {
|
|
5
|
-
throw new Error('NativeModules.RNRadar is undefined');
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const eventEmitter = new NativeEventEmitter(NativeModules.RNRadar);
|
|
9
|
-
|
|
10
|
-
const initialize = (publishableKey, fraud = false) => {
|
|
11
|
-
NativeModules.RNRadar.initialize(publishableKey, fraud);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const setLogLevel = (level) => {
|
|
15
|
-
NativeModules.RNRadar.setLogLevel(level);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const setUserId = (userId) => {
|
|
19
|
-
NativeModules.RNRadar.setUserId(userId);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const getUserId = () => (
|
|
23
|
-
NativeModules.RNRadar.getUserId()
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
const setDescription = (description) => {
|
|
27
|
-
NativeModules.RNRadar.setDescription(description);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const getDescription = () => (
|
|
31
|
-
NativeModules.RNRadar.getDescription()
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const setMetadata = (metadata) => {
|
|
35
|
-
NativeModules.RNRadar.setMetadata(metadata);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const getMetadata = () => (
|
|
39
|
-
NativeModules.RNRadar.getMetadata()
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
const setAnonymousTrackingEnabled = (enabled) => (
|
|
43
|
-
NativeModules.RNRadar.setAnonymousTrackingEnabled(enabled)
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
const getPermissionsStatus = () => (
|
|
47
|
-
NativeModules.RNRadar.getPermissionsStatus()
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const requestPermissions = background => (
|
|
51
|
-
NativeModules.RNRadar.requestPermissions(background)
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
const getLocation = desiredAccuracy => (
|
|
55
|
-
NativeModules.RNRadar.getLocation(desiredAccuracy)
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
const trackOnce = options => {
|
|
59
|
-
let backCompatibleOptions = options;
|
|
60
|
-
if (options && options.latitude) {
|
|
61
|
-
backCompatibleOptions = {
|
|
62
|
-
location: {
|
|
63
|
-
...options
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return NativeModules.RNRadar.trackOnce(backCompatibleOptions)
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const trackVerified = () => (
|
|
71
|
-
NativeModules.RNRadar.trackVerified()
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
const trackVerifiedToken = () => (
|
|
75
|
-
NativeModules.RNRadar.trackVerifiedToken()
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
const startTrackingEfficient = () => (
|
|
79
|
-
NativeModules.RNRadar.startTrackingEfficient()
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
const startTrackingResponsive = () => (
|
|
83
|
-
NativeModules.RNRadar.startTrackingResponsive()
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const startTrackingContinuous = () => (
|
|
87
|
-
NativeModules.RNRadar.startTrackingContinuous()
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
const startTrackingCustom = options => (
|
|
91
|
-
NativeModules.RNRadar.startTrackingCustom(options)
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
const mockTracking = options => (
|
|
95
|
-
NativeModules.RNRadar.mockTracking(options)
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
const stopTracking = () => (
|
|
99
|
-
NativeModules.RNRadar.stopTracking()
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
const getTrackingOptions = () => (
|
|
103
|
-
NativeModules.RNRadar.getTrackingOptions()
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
const isUsingRemoteTrackingOptions = () => (
|
|
107
|
-
NativeModules.RNRadar.isUsingRemoteTrackingOptions()
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
const isTracking = () => (
|
|
111
|
-
NativeModules.RNRadar.isTracking()
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
const setForegroundServiceOptions = options => (
|
|
115
|
-
NativeModules.RNRadar.setForegroundServiceOptions(options)
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
const setNotificationOptions = options => (
|
|
119
|
-
NativeModules.RNRadar.setNotificationOptions(options)
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
const getTripOptions = () => (
|
|
123
|
-
NativeModules.RNRadar.getTripOptions()
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
const startTrip = options => (
|
|
127
|
-
NativeModules.RNRadar.startTrip(options)
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
const completeTrip = () => (
|
|
131
|
-
NativeModules.RNRadar.completeTrip()
|
|
132
|
-
);
|
|
133
|
-
|
|
134
|
-
const cancelTrip = () => (
|
|
135
|
-
NativeModules.RNRadar.cancelTrip()
|
|
136
|
-
);
|
|
137
|
-
|
|
138
|
-
const updateTrip = options => (
|
|
139
|
-
NativeModules.RNRadar.updateTrip(options)
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
const acceptEvent = (eventId, verifiedPlaceId) => (
|
|
143
|
-
NativeModules.RNRadar.acceptEvent(eventId, verifiedPlaceId)
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
const rejectEvent = eventId => (
|
|
147
|
-
NativeModules.RNRadar.rejectEvent(eventId)
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
const getContext = location => (
|
|
151
|
-
NativeModules.RNRadar.getContext(location)
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
const searchPlaces = options => (
|
|
155
|
-
NativeModules.RNRadar.searchPlaces(options)
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
const searchGeofences = options => (
|
|
159
|
-
NativeModules.RNRadar.searchGeofences(options)
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
const autocomplete = options => (
|
|
163
|
-
NativeModules.RNRadar.autocomplete(options)
|
|
164
|
-
);
|
|
165
|
-
|
|
166
|
-
const geocode = address => (
|
|
167
|
-
NativeModules.RNRadar.geocode(address)
|
|
168
|
-
);
|
|
169
|
-
|
|
170
|
-
const reverseGeocode = location => (
|
|
171
|
-
NativeModules.RNRadar.reverseGeocode(location)
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
const ipGeocode = () => (
|
|
175
|
-
NativeModules.RNRadar.ipGeocode()
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
const getDistance = options => (
|
|
179
|
-
NativeModules.RNRadar.getDistance(options)
|
|
180
|
-
);
|
|
181
|
-
|
|
182
|
-
const getMatrix = options => (
|
|
183
|
-
NativeModules.RNRadar.getMatrix(options)
|
|
184
|
-
);
|
|
185
|
-
|
|
186
|
-
const logConversion = options => (
|
|
187
|
-
NativeModules.RNRadar.logConversion(options)
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
const sendEvent = (name, metadata) => (
|
|
191
|
-
NativeModules.RNRadar.sendEvent(name, metadata)
|
|
192
|
-
)
|
|
193
|
-
|
|
194
|
-
const on = (event, callback) => (
|
|
195
|
-
eventEmitter.addListener(event, callback)
|
|
196
|
-
);
|
|
197
|
-
|
|
198
|
-
const off = (event, callback) => {
|
|
199
|
-
if (callback) {
|
|
200
|
-
eventEmitter.removeListener(event, callback);
|
|
201
|
-
} else {
|
|
202
|
-
eventEmitter.removeAllListeners(event);
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
const nativeSdkVersion = () => (
|
|
207
|
-
NativeModules.RNRadar.nativeSdkVersion()
|
|
208
|
-
);
|
|
209
|
-
|
|
210
|
-
const rnSdkVersion = () => (version)
|
|
211
|
-
|
|
212
|
-
const Radar = {
|
|
213
|
-
initialize,
|
|
214
|
-
setLogLevel,
|
|
215
|
-
setUserId,
|
|
216
|
-
getUserId,
|
|
217
|
-
setDescription,
|
|
218
|
-
getDescription,
|
|
219
|
-
setMetadata,
|
|
220
|
-
getMetadata,
|
|
221
|
-
setAnonymousTrackingEnabled,
|
|
222
|
-
isUsingRemoteTrackingOptions,
|
|
223
|
-
getPermissionsStatus,
|
|
224
|
-
requestPermissions,
|
|
225
|
-
getLocation,
|
|
226
|
-
trackOnce,
|
|
227
|
-
trackVerified,
|
|
228
|
-
trackVerifiedToken,
|
|
229
|
-
startTrackingEfficient,
|
|
230
|
-
startTrackingResponsive,
|
|
231
|
-
startTrackingContinuous,
|
|
232
|
-
startTrackingCustom,
|
|
233
|
-
mockTracking,
|
|
234
|
-
stopTracking,
|
|
235
|
-
isTracking,
|
|
236
|
-
getTrackingOptions,
|
|
237
|
-
setForegroundServiceOptions,
|
|
238
|
-
setNotificationOptions,
|
|
239
|
-
acceptEvent,
|
|
240
|
-
rejectEvent,
|
|
241
|
-
getTripOptions,
|
|
242
|
-
startTrip,
|
|
243
|
-
updateTrip,
|
|
244
|
-
completeTrip,
|
|
245
|
-
cancelTrip,
|
|
246
|
-
getContext,
|
|
247
|
-
searchPlaces,
|
|
248
|
-
searchGeofences,
|
|
249
|
-
autocomplete,
|
|
250
|
-
geocode,
|
|
251
|
-
reverseGeocode,
|
|
252
|
-
ipGeocode,
|
|
253
|
-
getDistance,
|
|
254
|
-
getMatrix,
|
|
255
|
-
logConversion,
|
|
256
|
-
sendEvent,
|
|
257
|
-
on,
|
|
258
|
-
off,
|
|
259
|
-
nativeSdkVersion,
|
|
260
|
-
rnSdkVersion,
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
export default Radar;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{js → src}/helpers.js
RENAMED
|
File without changes
|
/package/{js → src}/ui/images.js
RENAMED
|
File without changes
|
/package/{js → src}/ui/map.jsx
RENAMED
|
File without changes
|
/package/{js → src}/ui/styles.js
RENAMED
|
File without changes
|