react-native-radar 3.18.4 → 3.18.5-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 +2 -2
- package/android/src/main/java/io/radar/react/RNRadarModule.java +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/index.native.js +5 -5
- package/dist/index.web.d.ts +50 -10
- package/dist/index.web.js +169 -38
- package/ios/Cartfile.resolved +1 -1
- package/ios/RNRadar.m +1 -1
- package/package.json +2 -2
- package/plugin/build/withRadarIOS.js +2 -3
- package/react-native-radar.podspec +1 -1
package/android/build.gradle
CHANGED
|
@@ -18,7 +18,7 @@ android {
|
|
|
18
18
|
minSdkVersion 16
|
|
19
19
|
targetSdkVersion 31
|
|
20
20
|
versionCode 1
|
|
21
|
-
versionName '3.18.
|
|
21
|
+
versionName '3.18.5-beta.2'
|
|
22
22
|
}
|
|
23
23
|
lintOptions {
|
|
24
24
|
abortOnError false
|
|
@@ -45,6 +45,6 @@ repositories {
|
|
|
45
45
|
|
|
46
46
|
dependencies {
|
|
47
47
|
api 'com.facebook.react:react-native:+'
|
|
48
|
-
api 'io.radar:sdk:3.18.
|
|
48
|
+
api 'io.radar:sdk:3.18.7-beta.1'
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -96,7 +96,7 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
96
96
|
this.fraud = fraud;
|
|
97
97
|
SharedPreferences.Editor editor = getReactApplicationContext().getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit();
|
|
98
98
|
editor.putString("x_platform_sdk_type", "ReactNative");
|
|
99
|
-
editor.putString("x_platform_sdk_version", "3.18.
|
|
99
|
+
editor.putString("x_platform_sdk_version", "3.18.5-beta.2");
|
|
100
100
|
editor.apply();
|
|
101
101
|
if (fraud) {
|
|
102
102
|
Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RadarNativeInterface } from "./@types/RadarNativeInterface";
|
|
2
|
-
declare let
|
|
3
|
-
export default
|
|
2
|
+
declare let nativeModule: RadarNativeInterface;
|
|
3
|
+
export default nativeModule;
|
|
4
4
|
declare let RadarRNWeb: any;
|
|
5
5
|
export { RadarRNWeb };
|
|
6
6
|
declare let Autocomplete: any;
|
package/dist/index.js
CHANGED
|
@@ -16,9 +16,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Map = exports.Autocomplete = exports.RadarRNWeb = void 0;
|
|
18
18
|
const react_native_1 = require("react-native");
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
exports.default =
|
|
19
|
+
let nativeModule;
|
|
20
|
+
nativeModule = react_native_1.Platform.OS === "web" ? require("./index.web").default : require("./index.native").default;
|
|
21
|
+
exports.default = nativeModule;
|
|
22
22
|
let RadarRNWeb = react_native_1.Platform.OS === "web" ? require("./index.web").default : {};
|
|
23
23
|
exports.RadarRNWeb = RadarRNWeb;
|
|
24
24
|
let Autocomplete = react_native_1.Platform.OS !== "web" ? require("./ui/autocomplete").default : {};
|
package/dist/index.native.js
CHANGED
|
@@ -48,9 +48,9 @@ const startTrackingVerified = (options) => react_native_1.NativeModules.RNRadar.
|
|
|
48
48
|
const mockTracking = (options) => react_native_1.NativeModules.RNRadar.mockTracking(options);
|
|
49
49
|
const stopTracking = () => react_native_1.NativeModules.RNRadar.stopTracking();
|
|
50
50
|
const stopTrackingVerified = () => react_native_1.NativeModules.RNRadar.stopTrackingVerified();
|
|
51
|
+
const isTracking = () => react_native_1.NativeModules.RNRadar.isTracking();
|
|
51
52
|
const getTrackingOptions = () => react_native_1.NativeModules.RNRadar.getTrackingOptions();
|
|
52
53
|
const isUsingRemoteTrackingOptions = () => react_native_1.NativeModules.RNRadar.isUsingRemoteTrackingOptions();
|
|
53
|
-
const isTracking = () => react_native_1.NativeModules.RNRadar.isTracking();
|
|
54
54
|
const setForegroundServiceOptions = (options) => react_native_1.NativeModules.RNRadar.setForegroundServiceOptions(options);
|
|
55
55
|
const setNotificationOptions = (options) => react_native_1.NativeModules.RNRadar.setNotificationOptions(options);
|
|
56
56
|
const getTripOptions = () => react_native_1.NativeModules.RNRadar.getTripOptions();
|
|
@@ -94,7 +94,6 @@ const Radar = {
|
|
|
94
94
|
setMetadata,
|
|
95
95
|
getMetadata,
|
|
96
96
|
setAnonymousTrackingEnabled,
|
|
97
|
-
isUsingRemoteTrackingOptions,
|
|
98
97
|
getPermissionsStatus,
|
|
99
98
|
requestPermissions,
|
|
100
99
|
getLocation,
|
|
@@ -111,15 +110,16 @@ const Radar = {
|
|
|
111
110
|
stopTrackingVerified,
|
|
112
111
|
isTracking,
|
|
113
112
|
getTrackingOptions,
|
|
113
|
+
isUsingRemoteTrackingOptions,
|
|
114
114
|
setForegroundServiceOptions,
|
|
115
115
|
setNotificationOptions,
|
|
116
|
-
acceptEvent,
|
|
117
|
-
rejectEvent,
|
|
118
116
|
getTripOptions,
|
|
119
117
|
startTrip,
|
|
120
|
-
updateTrip,
|
|
121
118
|
completeTrip,
|
|
122
119
|
cancelTrip,
|
|
120
|
+
updateTrip,
|
|
121
|
+
acceptEvent,
|
|
122
|
+
rejectEvent,
|
|
123
123
|
getContext,
|
|
124
124
|
searchPlaces,
|
|
125
125
|
searchGeofences,
|
package/dist/index.web.d.ts
CHANGED
|
@@ -3,27 +3,38 @@ declare namespace Radar {
|
|
|
3
3
|
export { initialize };
|
|
4
4
|
export { setLogLevel };
|
|
5
5
|
export { setUserId };
|
|
6
|
+
export { getUserId };
|
|
6
7
|
export { setDescription };
|
|
8
|
+
export { getDescription };
|
|
7
9
|
export { setMetadata };
|
|
10
|
+
export { getMetadata };
|
|
11
|
+
export { setAnonymousTrackingEnabled };
|
|
8
12
|
export { getPermissionsStatus };
|
|
9
13
|
export { requestPermissions };
|
|
10
14
|
export { getLocation };
|
|
11
15
|
export { trackOnce };
|
|
12
16
|
export { trackVerified };
|
|
13
|
-
export {
|
|
17
|
+
export { getVerifiedLocationToken };
|
|
14
18
|
export { startTrackingEfficient };
|
|
15
19
|
export { startTrackingResponsive };
|
|
16
20
|
export { startTrackingContinuous };
|
|
17
21
|
export { startTrackingCustom };
|
|
22
|
+
export { startTrackingVerified };
|
|
18
23
|
export { mockTracking };
|
|
19
24
|
export { stopTracking };
|
|
25
|
+
export { stopTrackingVerified };
|
|
26
|
+
export { isTracking };
|
|
27
|
+
export { getTrackingOptions };
|
|
28
|
+
export { isUsingRemoteTrackingOptions };
|
|
20
29
|
export { setForegroundServiceOptions };
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
30
|
+
export { setNotificationOptions };
|
|
31
|
+
export { getTripOptions };
|
|
23
32
|
export { startTrip };
|
|
24
|
-
export { updateTrip };
|
|
25
33
|
export { completeTrip };
|
|
26
34
|
export { cancelTrip };
|
|
35
|
+
export { updateTrip };
|
|
36
|
+
export { acceptEvent };
|
|
37
|
+
export { rejectEvent };
|
|
27
38
|
export { getContext };
|
|
28
39
|
export { searchPlaces };
|
|
29
40
|
export { searchGeofences };
|
|
@@ -31,35 +42,55 @@ declare namespace Radar {
|
|
|
31
42
|
export { geocode };
|
|
32
43
|
export { reverseGeocode };
|
|
33
44
|
export { ipGeocode };
|
|
45
|
+
export { validateAddress };
|
|
34
46
|
export { getDistance };
|
|
35
47
|
export { getMatrix };
|
|
48
|
+
export { logConversion };
|
|
49
|
+
export { sendEvent };
|
|
36
50
|
export { on };
|
|
37
51
|
export { off };
|
|
52
|
+
export { nativeSdkVersion };
|
|
53
|
+
export { rnSdkVersion };
|
|
54
|
+
export { throwOnUnimplemented };
|
|
55
|
+
export { setDeviceId };
|
|
56
|
+
export { setDeviceType };
|
|
57
|
+
export { setRequestHeaders };
|
|
38
58
|
}
|
|
39
59
|
declare function initialize(publishableKey: any): void;
|
|
40
60
|
declare function setLogLevel(level: any): void;
|
|
41
61
|
declare function setUserId(userId: any): void;
|
|
62
|
+
declare function getUserId(): Promise<any>;
|
|
42
63
|
declare function setDescription(description: any): void;
|
|
64
|
+
declare function getDescription(): Promise<any>;
|
|
43
65
|
declare function setMetadata(metadata: any): void;
|
|
66
|
+
declare function getMetadata(): Promise<any>;
|
|
67
|
+
declare function setAnonymousTrackingEnabled(): void;
|
|
44
68
|
declare function getPermissionsStatus(): Promise<any>;
|
|
45
|
-
declare function requestPermissions(background: any):
|
|
69
|
+
declare function requestPermissions(background: any): Promise<any>;
|
|
46
70
|
declare function getLocation(): Promise<any>;
|
|
47
71
|
declare function trackOnce(options: any): Promise<any>;
|
|
48
|
-
declare function trackVerified():
|
|
49
|
-
declare function
|
|
72
|
+
declare function trackVerified(): Promise<any>;
|
|
73
|
+
declare function getVerifiedLocationToken(): Promise<any>;
|
|
50
74
|
declare function startTrackingEfficient(): void;
|
|
51
75
|
declare function startTrackingResponsive(): void;
|
|
52
76
|
declare function startTrackingContinuous(): void;
|
|
53
77
|
declare function startTrackingCustom(options: any): void;
|
|
78
|
+
declare function startTrackingVerified(options: any): void;
|
|
54
79
|
declare function mockTracking(options: any): void;
|
|
55
80
|
declare function stopTracking(): void;
|
|
81
|
+
declare function stopTrackingVerified(): void;
|
|
82
|
+
declare function isTracking(): Promise<any>;
|
|
83
|
+
declare function getTrackingOptions(): Promise<any>;
|
|
84
|
+
declare function isUsingRemoteTrackingOptions(): Promise<any>;
|
|
56
85
|
declare function setForegroundServiceOptions(options: any): void;
|
|
57
|
-
declare function
|
|
58
|
-
declare function
|
|
86
|
+
declare function setNotificationOptions(options: any): void;
|
|
87
|
+
declare function getTripOptions(): Promise<any>;
|
|
59
88
|
declare function startTrip(options: any): Promise<any>;
|
|
60
|
-
declare function updateTrip(tripOptions: any): Promise<any>;
|
|
61
89
|
declare function completeTrip(): Promise<any>;
|
|
62
90
|
declare function cancelTrip(): Promise<any>;
|
|
91
|
+
declare function updateTrip(tripOptions: any): Promise<any>;
|
|
92
|
+
declare function acceptEvent(eventId: any, verifiedPlaceId: any): void;
|
|
93
|
+
declare function rejectEvent(eventId: any): void;
|
|
63
94
|
declare function getContext(options: any): Promise<any>;
|
|
64
95
|
declare function searchPlaces(options: any): Promise<any>;
|
|
65
96
|
declare function searchGeofences(options: any): Promise<any>;
|
|
@@ -67,7 +98,16 @@ declare function autocomplete(options: any): Promise<any>;
|
|
|
67
98
|
declare function geocode(options: any): Promise<any>;
|
|
68
99
|
declare function reverseGeocode(options: any): Promise<any>;
|
|
69
100
|
declare function ipGeocode(): Promise<any>;
|
|
101
|
+
declare function validateAddress(options: any): Promise<any>;
|
|
70
102
|
declare function getDistance(options: any): Promise<any>;
|
|
71
103
|
declare function getMatrix(options: any): Promise<any>;
|
|
104
|
+
declare function logConversion(options: any): Promise<any>;
|
|
105
|
+
declare function sendEvent(name: any, metadata: any): void;
|
|
72
106
|
declare function on(event: any, callback: any): void;
|
|
73
107
|
declare function off(event: any, callback: any): void;
|
|
108
|
+
declare function nativeSdkVersion(): Promise<any>;
|
|
109
|
+
declare function rnSdkVersion(): string;
|
|
110
|
+
declare function throwOnUnimplemented(value: any): void;
|
|
111
|
+
declare function setDeviceId(deviceId: any, installId: any): void;
|
|
112
|
+
declare function setDeviceType(deviceType: any): void;
|
|
113
|
+
declare function setRequestHeaders(headers: any): void;
|
package/dist/index.web.js
CHANGED
|
@@ -4,15 +4,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const radar_sdk_js_1 = __importDefault(require("radar-sdk-js"));
|
|
7
|
+
const package_json_1 = require("../package.json");
|
|
8
|
+
let throws = false;
|
|
9
|
+
const throwOnUnimplemented = (value) => {
|
|
10
|
+
throws = value;
|
|
11
|
+
};
|
|
7
12
|
const initialize = (publishableKey) => {
|
|
8
13
|
radar_sdk_js_1.default.initialize(publishableKey);
|
|
9
14
|
};
|
|
10
15
|
const setLogLevel = (level) => {
|
|
11
|
-
|
|
16
|
+
if (throws)
|
|
17
|
+
throw new Error("setLogLevel() is not implemented on web");
|
|
12
18
|
};
|
|
13
19
|
const setUserId = (userId) => {
|
|
14
20
|
radar_sdk_js_1.default.setUserId(userId);
|
|
15
21
|
};
|
|
22
|
+
const getUserId = () => {
|
|
23
|
+
if (throws)
|
|
24
|
+
throw new Error("getUserId() is not implemented on web");
|
|
25
|
+
return new Promise((resolve, reject) => { reject("getUserId() is not implemented on web"); });
|
|
26
|
+
};
|
|
16
27
|
const setDeviceId = (deviceId, installId) => {
|
|
17
28
|
radar_sdk_js_1.default.setDeviceId(deviceId, installId);
|
|
18
29
|
};
|
|
@@ -25,9 +36,23 @@ const setRequestHeaders = (headers) => {
|
|
|
25
36
|
const setDescription = (description) => {
|
|
26
37
|
radar_sdk_js_1.default.setDescription(description);
|
|
27
38
|
};
|
|
39
|
+
const getDescription = () => {
|
|
40
|
+
if (throws)
|
|
41
|
+
throw new Error("getDescription() is not implemented on web");
|
|
42
|
+
return new Promise((resolve, reject) => { reject("getDescription() is not implemented on web"); });
|
|
43
|
+
};
|
|
28
44
|
const setMetadata = (metadata) => {
|
|
29
45
|
radar_sdk_js_1.default.setMetadata(metadata);
|
|
30
46
|
};
|
|
47
|
+
const getMetadata = () => {
|
|
48
|
+
if (throws)
|
|
49
|
+
throw new Error("getMetadata() is not implemented on web");
|
|
50
|
+
return new Promise((resolve, reject) => { reject("getMetadata() is not implemented on web"); });
|
|
51
|
+
};
|
|
52
|
+
const setAnonymousTrackingEnabled = () => {
|
|
53
|
+
if (throws)
|
|
54
|
+
throw new Error("setAnonymousTrackingEnabled() is not implemented on web");
|
|
55
|
+
};
|
|
31
56
|
const getPermissionsStatus = () => {
|
|
32
57
|
return new Promise(resolve => {
|
|
33
58
|
const navigator = window.navigator;
|
|
@@ -45,8 +70,10 @@ const getPermissionsStatus = () => {
|
|
|
45
70
|
}
|
|
46
71
|
});
|
|
47
72
|
};
|
|
48
|
-
const requestPermissions = background => {
|
|
49
|
-
|
|
73
|
+
const requestPermissions = (background) => {
|
|
74
|
+
if (throws)
|
|
75
|
+
throw new Error("requestPermissions() is not implemented on web");
|
|
76
|
+
return new Promise((resolve, reject) => { reject("requestPermissions() is not implemented on web"); });
|
|
50
77
|
};
|
|
51
78
|
const getLocation = () => {
|
|
52
79
|
return new Promise((resolve, reject) => {
|
|
@@ -58,7 +85,7 @@ const getLocation = () => {
|
|
|
58
85
|
});
|
|
59
86
|
});
|
|
60
87
|
};
|
|
61
|
-
const trackOnce = options => {
|
|
88
|
+
const trackOnce = (options) => {
|
|
62
89
|
return new Promise((resolve, reject) => {
|
|
63
90
|
const callback = (err, { status, location, user, events }) => {
|
|
64
91
|
if (err) {
|
|
@@ -82,33 +109,80 @@ const trackOnce = options => {
|
|
|
82
109
|
});
|
|
83
110
|
};
|
|
84
111
|
const trackVerified = () => {
|
|
85
|
-
|
|
112
|
+
if (throws)
|
|
113
|
+
throw new Error("trackVerified() is not implemented on web");
|
|
114
|
+
return new Promise((resolve, reject) => { reject("trackVerified() is not implemented on web"); });
|
|
86
115
|
};
|
|
87
|
-
const
|
|
88
|
-
|
|
116
|
+
const getVerifiedLocationToken = () => {
|
|
117
|
+
if (throws)
|
|
118
|
+
throw new Error("getVerifiedLocationToken() is not implemented on web");
|
|
119
|
+
return new Promise((resolve, reject) => { reject("getVerifiedLocationToken() is not implemented on web"); });
|
|
89
120
|
};
|
|
90
121
|
const startTrackingEfficient = () => {
|
|
91
|
-
|
|
122
|
+
if (throws)
|
|
123
|
+
throw new Error("startTrackingEfficient() is not implemented on web");
|
|
92
124
|
};
|
|
93
125
|
const startTrackingResponsive = () => {
|
|
94
|
-
|
|
126
|
+
if (throws)
|
|
127
|
+
throw new Error("startTrackingResponsive() is not implemented on web");
|
|
95
128
|
};
|
|
96
129
|
const startTrackingContinuous = () => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const startTrackingCustom = options => {
|
|
100
|
-
// not implemented
|
|
130
|
+
if (throws)
|
|
131
|
+
throw new Error("startTrackingContinuous() is not implemented on web");
|
|
101
132
|
};
|
|
102
|
-
const
|
|
103
|
-
|
|
133
|
+
const startTrackingCustom = (options) => {
|
|
134
|
+
if (throws)
|
|
135
|
+
throw new Error("startTrackingCustom() is not implemented on web");
|
|
104
136
|
};
|
|
105
|
-
const
|
|
106
|
-
|
|
137
|
+
const startTrackingVerified = (options) => {
|
|
138
|
+
if (throws)
|
|
139
|
+
throw new Error("startTrackingVerified() is not implemented on web");
|
|
107
140
|
};
|
|
108
|
-
const
|
|
109
|
-
|
|
141
|
+
const mockTracking = (options) => {
|
|
142
|
+
if (throws)
|
|
143
|
+
throw new Error("mockTracking() is not implemented on web");
|
|
110
144
|
};
|
|
111
|
-
const
|
|
145
|
+
const stopTracking = () => {
|
|
146
|
+
if (throws)
|
|
147
|
+
throw new Error("stopTracking() is not implemented on web");
|
|
148
|
+
};
|
|
149
|
+
const stopTrackingVerified = () => {
|
|
150
|
+
if (throws)
|
|
151
|
+
throw new Error("stopTrackingVerified() is not implemented on web");
|
|
152
|
+
};
|
|
153
|
+
const isTracking = () => {
|
|
154
|
+
if (throws)
|
|
155
|
+
throw new Error("isTracking() is not implemented on web");
|
|
156
|
+
return new Promise((resolve, reject) => { reject("isTracking() is not implemented on web"); });
|
|
157
|
+
};
|
|
158
|
+
const getTrackingOptions = () => {
|
|
159
|
+
if (throws)
|
|
160
|
+
throw new Error("getTrackingOptions() is not implemented on web");
|
|
161
|
+
return new Promise((resolve, reject) => { reject("getTrackingOptions() is not implemented on web"); });
|
|
162
|
+
};
|
|
163
|
+
const isUsingRemoteTrackingOptions = () => {
|
|
164
|
+
if (throws)
|
|
165
|
+
throw new Error("isUsingRemoteTrackingOptions() is not implemented on web");
|
|
166
|
+
return new Promise((resolve, reject) => { reject("isUsingRemoteTrackingOptions() is not implemented on web"); });
|
|
167
|
+
};
|
|
168
|
+
const setForegroundServiceOptions = (options) => {
|
|
169
|
+
if (throws)
|
|
170
|
+
throw new Error("setForegroundServiceOptions() is not implemented on web");
|
|
171
|
+
};
|
|
172
|
+
const setNotificationOptions = (options) => {
|
|
173
|
+
if (throws)
|
|
174
|
+
throw new Error("setNotificationOptions() is not implemented on web");
|
|
175
|
+
};
|
|
176
|
+
const getTripOptions = () => {
|
|
177
|
+
if (throws)
|
|
178
|
+
throw new Error("getTripOptions() is not implemented on web");
|
|
179
|
+
return new Promise((resolve, reject) => { reject("getTripOptions() is not implemented on web"); });
|
|
180
|
+
};
|
|
181
|
+
const startTrip = (options) => {
|
|
182
|
+
if (options.tripOptions) {
|
|
183
|
+
options = options.tripOptions;
|
|
184
|
+
}
|
|
185
|
+
console.log(options);
|
|
112
186
|
return new Promise((resolve, reject) => {
|
|
113
187
|
const callback = (err, { trip, events, status }) => {
|
|
114
188
|
if (err) {
|
|
@@ -177,12 +251,14 @@ const updateTrip = (tripOptions) => {
|
|
|
177
251
|
});
|
|
178
252
|
};
|
|
179
253
|
const acceptEvent = (eventId, verifiedPlaceId) => {
|
|
180
|
-
|
|
254
|
+
if (throws)
|
|
255
|
+
throw new Error("acceptEvent() is not implemented on web");
|
|
181
256
|
};
|
|
182
|
-
const rejectEvent = eventId => {
|
|
183
|
-
|
|
257
|
+
const rejectEvent = (eventId) => {
|
|
258
|
+
if (throws)
|
|
259
|
+
throw new Error("rejectEvent() is not implemented on web");
|
|
184
260
|
};
|
|
185
|
-
const getContext = options => {
|
|
261
|
+
const getContext = (options) => {
|
|
186
262
|
return new Promise((resolve, reject) => {
|
|
187
263
|
const callback = (err, { status, location, context }) => {
|
|
188
264
|
if (err) {
|
|
@@ -204,7 +280,7 @@ const getContext = options => {
|
|
|
204
280
|
}
|
|
205
281
|
});
|
|
206
282
|
};
|
|
207
|
-
const searchPlaces = options => {
|
|
283
|
+
const searchPlaces = (options) => {
|
|
208
284
|
return new Promise((resolve, reject) => {
|
|
209
285
|
radar_sdk_js_1.default.searchPlaces(options, (err, { status, location, places }) => {
|
|
210
286
|
if (err) {
|
|
@@ -220,7 +296,7 @@ const searchPlaces = options => {
|
|
|
220
296
|
});
|
|
221
297
|
});
|
|
222
298
|
};
|
|
223
|
-
const searchGeofences = options => {
|
|
299
|
+
const searchGeofences = (options) => {
|
|
224
300
|
return new Promise((resolve, reject) => {
|
|
225
301
|
radar_sdk_js_1.default.searchGeofences(options, (err, { status, location, geofences }) => {
|
|
226
302
|
if (err) {
|
|
@@ -236,7 +312,7 @@ const searchGeofences = options => {
|
|
|
236
312
|
});
|
|
237
313
|
});
|
|
238
314
|
};
|
|
239
|
-
const autocomplete = options => {
|
|
315
|
+
const autocomplete = (options) => {
|
|
240
316
|
return new Promise((resolve, reject) => {
|
|
241
317
|
radar_sdk_js_1.default.autocomplete(options, (err, { status, addresses }) => {
|
|
242
318
|
if (err) {
|
|
@@ -251,13 +327,17 @@ const autocomplete = options => {
|
|
|
251
327
|
});
|
|
252
328
|
});
|
|
253
329
|
};
|
|
254
|
-
const geocode = options => {
|
|
330
|
+
const geocode = (options) => {
|
|
255
331
|
return new Promise((resolve, reject) => {
|
|
256
332
|
let newOptions = options;
|
|
257
|
-
if (typeof options === 'string')
|
|
333
|
+
if (typeof options === 'string') {
|
|
258
334
|
newOptions = {
|
|
259
335
|
query: options
|
|
260
336
|
};
|
|
337
|
+
}
|
|
338
|
+
else if (options.address) {
|
|
339
|
+
newOptions.query = options.address;
|
|
340
|
+
}
|
|
261
341
|
radar_sdk_js_1.default.geocode(newOptions, (err, { status, addresses }) => {
|
|
262
342
|
if (err) {
|
|
263
343
|
reject(err);
|
|
@@ -271,7 +351,7 @@ const geocode = options => {
|
|
|
271
351
|
});
|
|
272
352
|
});
|
|
273
353
|
};
|
|
274
|
-
const reverseGeocode = options => {
|
|
354
|
+
const reverseGeocode = (options) => {
|
|
275
355
|
return new Promise((resolve, reject) => {
|
|
276
356
|
const callback = (err, { status, addresses }) => {
|
|
277
357
|
if (err) {
|
|
@@ -307,7 +387,22 @@ const ipGeocode = () => {
|
|
|
307
387
|
});
|
|
308
388
|
});
|
|
309
389
|
};
|
|
310
|
-
const
|
|
390
|
+
const validateAddress = (options) => {
|
|
391
|
+
return new Promise((resolve, reject) => {
|
|
392
|
+
radar_sdk_js_1.default.validateAddress(options, (err, { status, address }) => {
|
|
393
|
+
if (err) {
|
|
394
|
+
reject(err);
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
resolve({
|
|
398
|
+
status,
|
|
399
|
+
address
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
};
|
|
405
|
+
const getDistance = (options) => {
|
|
311
406
|
return new Promise((resolve, reject) => {
|
|
312
407
|
radar_sdk_js_1.default.getDistance(options, (err, { status, routes }) => {
|
|
313
408
|
if (err) {
|
|
@@ -322,7 +417,7 @@ const getDistance = options => {
|
|
|
322
417
|
});
|
|
323
418
|
});
|
|
324
419
|
};
|
|
325
|
-
const getMatrix = options => {
|
|
420
|
+
const getMatrix = (options) => {
|
|
326
421
|
return new Promise((resolve, reject) => {
|
|
327
422
|
radar_sdk_js_1.default.getMatrix(options, (err, { origins, destinations, matrix, status }) => {
|
|
328
423
|
if (err) {
|
|
@@ -339,37 +434,63 @@ const getMatrix = options => {
|
|
|
339
434
|
});
|
|
340
435
|
});
|
|
341
436
|
};
|
|
437
|
+
const logConversion = (options) => {
|
|
438
|
+
if (throws)
|
|
439
|
+
throw new Error("logConversion() is not implemented on web");
|
|
440
|
+
return new Promise((resolve, reject) => { reject("logConversion() is not implemented on web"); });
|
|
441
|
+
};
|
|
442
|
+
const sendEvent = (name, metadata) => {
|
|
443
|
+
if (throws)
|
|
444
|
+
throw new Error("sendEvent() is not implemented on web");
|
|
445
|
+
};
|
|
342
446
|
const on = (event, callback) => {
|
|
343
|
-
|
|
447
|
+
if (throws)
|
|
448
|
+
throw new Error("on() is not implemented on web");
|
|
344
449
|
};
|
|
345
450
|
const off = (event, callback) => {
|
|
346
|
-
|
|
451
|
+
if (throws)
|
|
452
|
+
throw new Error("off() is not implemented on web");
|
|
347
453
|
};
|
|
454
|
+
const nativeSdkVersion = () => {
|
|
455
|
+
return new Promise((resolve, reject) => { resolve(radar_sdk_js_1.default.VERSION); });
|
|
456
|
+
};
|
|
457
|
+
const rnSdkVersion = () => package_json_1.version;
|
|
348
458
|
const Radar = {
|
|
349
459
|
initialize,
|
|
350
460
|
setLogLevel,
|
|
351
461
|
setUserId,
|
|
462
|
+
getUserId,
|
|
352
463
|
setDescription,
|
|
464
|
+
getDescription,
|
|
353
465
|
setMetadata,
|
|
466
|
+
getMetadata,
|
|
467
|
+
setAnonymousTrackingEnabled,
|
|
354
468
|
getPermissionsStatus,
|
|
355
469
|
requestPermissions,
|
|
356
470
|
getLocation,
|
|
357
471
|
trackOnce,
|
|
358
472
|
trackVerified,
|
|
359
|
-
|
|
473
|
+
getVerifiedLocationToken,
|
|
360
474
|
startTrackingEfficient,
|
|
361
475
|
startTrackingResponsive,
|
|
362
476
|
startTrackingContinuous,
|
|
363
477
|
startTrackingCustom,
|
|
478
|
+
startTrackingVerified,
|
|
364
479
|
mockTracking,
|
|
365
480
|
stopTracking,
|
|
481
|
+
stopTrackingVerified,
|
|
482
|
+
isTracking,
|
|
483
|
+
getTrackingOptions,
|
|
484
|
+
isUsingRemoteTrackingOptions,
|
|
366
485
|
setForegroundServiceOptions,
|
|
367
|
-
|
|
368
|
-
|
|
486
|
+
setNotificationOptions,
|
|
487
|
+
getTripOptions,
|
|
369
488
|
startTrip,
|
|
370
|
-
updateTrip,
|
|
371
489
|
completeTrip,
|
|
372
490
|
cancelTrip,
|
|
491
|
+
updateTrip,
|
|
492
|
+
acceptEvent,
|
|
493
|
+
rejectEvent,
|
|
373
494
|
getContext,
|
|
374
495
|
searchPlaces,
|
|
375
496
|
searchGeofences,
|
|
@@ -377,9 +498,19 @@ const Radar = {
|
|
|
377
498
|
geocode,
|
|
378
499
|
reverseGeocode,
|
|
379
500
|
ipGeocode,
|
|
501
|
+
validateAddress,
|
|
380
502
|
getDistance,
|
|
381
503
|
getMatrix,
|
|
504
|
+
logConversion,
|
|
505
|
+
sendEvent,
|
|
382
506
|
on,
|
|
383
507
|
off,
|
|
508
|
+
nativeSdkVersion,
|
|
509
|
+
rnSdkVersion,
|
|
510
|
+
// only for web, these should be called via RadarRNWeb instead of Radar for typing
|
|
511
|
+
throwOnUnimplemented,
|
|
512
|
+
setDeviceId,
|
|
513
|
+
setDeviceType,
|
|
514
|
+
setRequestHeaders,
|
|
384
515
|
};
|
|
385
516
|
exports.default = Radar;
|
package/ios/Cartfile.resolved
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
github "radarlabs/radar-sdk-ios" "3.18.
|
|
1
|
+
github "radarlabs/radar-sdk-ios" "3.18.6-beta.1"
|
package/ios/RNRadar.m
CHANGED
|
@@ -102,7 +102,7 @@ RCT_EXPORT_MODULE();
|
|
|
102
102
|
|
|
103
103
|
RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud) {
|
|
104
104
|
[[NSUserDefaults standardUserDefaults] setObject:@"ReactNative" forKey:@"radar-xPlatformSDKType"];
|
|
105
|
-
[[NSUserDefaults standardUserDefaults] setObject:@"3.18.
|
|
105
|
+
[[NSUserDefaults standardUserDefaults] setObject:@"3.18.5-beta.2" forKey:@"radar-xPlatformSDKVersion"];
|
|
106
106
|
[Radar initializeWithPublishableKey:publishableKey];
|
|
107
107
|
}
|
|
108
108
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "React Native module for Radar, the leading geofencing and location tracking platform",
|
|
4
4
|
"homepage": "https://radar.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"version": "3.18.
|
|
6
|
+
"version": "3.18.5-beta.2",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"/android",
|
|
@@ -89,6 +89,6 @@
|
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@babel/runtime": "^7.21.0",
|
|
91
91
|
"@react-native-community/netinfo": "^7.1.3",
|
|
92
|
-
"radar-sdk-js": "^3.
|
|
92
|
+
"radar-sdk-js": "^3.7.1"
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -51,8 +51,7 @@ const withRadarIOS = (config, args) => {
|
|
|
51
51
|
const filePath = path_1.default.join(config.modRequest.platformProjectRoot, 'Podfile');
|
|
52
52
|
const contents = await promises_1.default.readFile(filePath, 'utf-8');
|
|
53
53
|
// Check if the pod declaration already exists
|
|
54
|
-
|
|
55
|
-
if (contents.indexOf(`pod 'RadarSDKMotion', ${RadarSDKMotionVersion}`) === -1) {
|
|
54
|
+
if (contents.indexOf("pod 'RadarSDKMotion', '3.18.6-beta.1'") === -1) {
|
|
56
55
|
// Find the target block
|
|
57
56
|
const targetRegex = /target '(\w+)' do/g;
|
|
58
57
|
const match = targetRegex.exec(contents);
|
|
@@ -61,7 +60,7 @@ const withRadarIOS = (config, args) => {
|
|
|
61
60
|
const targetEndIndex = contents.indexOf('end', targetStartIndex) + 3;
|
|
62
61
|
// Insert the pod declaration within the target block
|
|
63
62
|
const targetBlock = contents.substring(targetStartIndex, targetEndIndex);
|
|
64
|
-
const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.18.
|
|
63
|
+
const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.18.6-beta.1'`);
|
|
65
64
|
const newContents = contents.replace(targetBlock, updatedTargetBlock);
|
|
66
65
|
// Write the updated contents back to the Podfile
|
|
67
66
|
await promises_1.default.writeFile(filePath, newContents);
|