react-native-radar 3.18.1 → 3.18.3
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 +38 -42
- package/dist/@types/RadarNativeInterface.d.ts +2 -1
- package/dist/@types/types.d.ts +13 -0
- package/dist/@types/types.js +4 -3
- package/dist/index.native.js +2 -0
- package/dist/ui/styles.d.ts +171 -1
- package/ios/Cartfile.resolved +1 -1
- package/ios/RNRadar.m +28 -1
- package/package.json +10 -7
- package/plugin/build/withRadarIOS.js +3 -2
- 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.3'
|
|
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.5'
|
|
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.3");
|
|
100
100
|
editor.apply();
|
|
101
101
|
if (fraud) {
|
|
102
102
|
Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud);
|
|
@@ -250,14 +250,14 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
250
250
|
|
|
251
251
|
@ReactMethod
|
|
252
252
|
public void requestPermissions(boolean background, final Promise promise) {
|
|
253
|
-
|
|
253
|
+
Activity activity =getCurrentActivity();
|
|
254
254
|
mPermissionsRequestPromise = promise;
|
|
255
255
|
if (activity != null) {
|
|
256
256
|
if (Build.VERSION.SDK_INT >= 23) {
|
|
257
257
|
if (background && Build.VERSION.SDK_INT >= 29) {
|
|
258
|
-
|
|
258
|
+
ActivityCompat.requestPermissions(activity, new String[] { Manifest.permission.ACCESS_BACKGROUND_LOCATION }, PERMISSIONS_REQUEST_CODE);
|
|
259
259
|
} else {
|
|
260
|
-
|
|
260
|
+
ActivityCompat.requestPermissions(activity, new String[] { Manifest.permission.ACCESS_FINE_LOCATION }, PERMISSIONS_REQUEST_CODE);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
}
|
|
@@ -782,12 +782,12 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
782
782
|
}
|
|
783
783
|
|
|
784
784
|
@ReactMethod
|
|
785
|
-
public void getContext(final Promise promise) {
|
|
785
|
+
public void getContext(@Nullable ReadableMap locationMap, final Promise promise) {
|
|
786
786
|
if (promise == null) {
|
|
787
787
|
return;
|
|
788
788
|
}
|
|
789
789
|
|
|
790
|
-
Radar.
|
|
790
|
+
Radar.RadarContextCallback callback = new Radar.RadarContextCallback() {
|
|
791
791
|
@Override
|
|
792
792
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable Location location, @Nullable RadarContext context) {
|
|
793
793
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
@@ -809,44 +809,18 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
809
809
|
promise.reject(status.toString(), status.toString());
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
}
|
|
813
|
-
}
|
|
812
|
+
};
|
|
814
813
|
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
814
|
+
if (locationMap == null) {
|
|
815
|
+
Radar.getContext(callback);
|
|
816
|
+
} else {
|
|
817
|
+
double latitude = locationMap.getDouble("latitude");
|
|
818
|
+
double longitude = locationMap.getDouble("longitude");
|
|
819
|
+
Location location = new Location("RNRadarModule");
|
|
820
|
+
location.setLatitude(latitude);
|
|
821
|
+
location.setLongitude(longitude);
|
|
822
|
+
Radar.getContext(location, callback);
|
|
819
823
|
}
|
|
820
|
-
|
|
821
|
-
double latitude = locationMap.getDouble("latitude");
|
|
822
|
-
double longitude = locationMap.getDouble("longitude");
|
|
823
|
-
Location location = new Location("RNRadarModule");
|
|
824
|
-
location.setLatitude(latitude);
|
|
825
|
-
location.setLongitude(longitude);
|
|
826
|
-
|
|
827
|
-
Radar.getContext(location, new Radar.RadarContextCallback() {
|
|
828
|
-
@Override
|
|
829
|
-
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable Location location, @Nullable RadarContext context) {
|
|
830
|
-
if (status == Radar.RadarStatus.SUCCESS) {
|
|
831
|
-
try {
|
|
832
|
-
WritableMap map = Arguments.createMap();
|
|
833
|
-
map.putString("status", status.toString());
|
|
834
|
-
if (location != null) {
|
|
835
|
-
map.putMap("location", RNRadarUtils.mapForJson(Radar.jsonForLocation(location)));
|
|
836
|
-
}
|
|
837
|
-
if (context != null) {
|
|
838
|
-
map.putMap("context", RNRadarUtils.mapForJson(context.toJson()));
|
|
839
|
-
}
|
|
840
|
-
promise.resolve(map);
|
|
841
|
-
} catch (JSONException e) {
|
|
842
|
-
Log.e(TAG, "JSONException", e);
|
|
843
|
-
promise.reject(Radar.RadarStatus.ERROR_SERVER.toString(), Radar.RadarStatus.ERROR_SERVER.toString());
|
|
844
|
-
}
|
|
845
|
-
} else {
|
|
846
|
-
promise.reject(status.toString(), status.toString());
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
824
|
}
|
|
851
825
|
|
|
852
826
|
@ReactMethod
|
|
@@ -1139,6 +1113,28 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
1139
1113
|
});
|
|
1140
1114
|
}
|
|
1141
1115
|
|
|
1116
|
+
@ReactMethod
|
|
1117
|
+
public void validateAddress(ReadableMap addressMap, final Promise promise) {
|
|
1118
|
+
RadarAddress address = RadarAddress.fromJson(RNRadarUtils.jsonForMap(addressMap));
|
|
1119
|
+
Radar.validateAddress(address, new RadarValidateAddressCallback {
|
|
1120
|
+
@Override
|
|
1121
|
+
onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarAddress address, @Nullable RadarAddressVerificationStatus verificationStatus) {
|
|
1122
|
+
if (status == Radar.RadarStatus.SUCCESS && ) {
|
|
1123
|
+
map.putString("status", status.toString());
|
|
1124
|
+
if (address != null) {
|
|
1125
|
+
map.putMap("address", RNRadarUtils.mapForJson(address.toJson()));
|
|
1126
|
+
}
|
|
1127
|
+
if (verificationStatus != null) {
|
|
1128
|
+
map.putString("verificationStatus", verificationStatus.toString());
|
|
1129
|
+
}
|
|
1130
|
+
promise.resolve(map);
|
|
1131
|
+
} else {
|
|
1132
|
+
promise.reject(status.toString, status.toString());
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1142
1138
|
@ReactMethod
|
|
1143
1139
|
public void getDistance(ReadableMap optionsMap, final Promise promise) {
|
|
1144
1140
|
if (promise == null) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Location, RadarAutocompleteOptions, RadarContextCallback,
|
|
1
|
+
import { Location, RadarAddress, RadarAddressCallback, RadarAutocompleteOptions, RadarContextCallback, RadarEventChannel, RadarGeocodeOptions, RadarGetDistanceOptions, RadarGetMatrixOptions, RadarIPGeocodeCallback, RadarListenerCallback, RadarLocationCallback, RadarLogConversionCallback, RadarLogConversionOptions, RadarLogLevel, RadarMetadata, RadarMockTrackingOptions, RadarNotificationOptions, RadarPermissionsStatus, RadarReverseGeocodeOptions, RadarRouteCallback, RadarRouteMatrix, RadarSearchGeofencesCallback, RadarSearchGeofencesOptions, RadarSearchPlacesCallback, RadarSearchPlacesOptions, RadarStartTripOptions, RadarTrackCallback, RadarTrackingOptions, RadarTrackingOptionsDesiredAccuracy, RadarTrackingOptionsForegroundService, RadarTrackOnceOptions, RadarTrackVerifiedCallback, RadarTrackVerifiedOptions, RadarTripCallback, RadarTripOptions, RadarUpdateTripOptions, RadarValidateAddressCallback, RadarVerifiedTrackingOptions } from "./types";
|
|
2
2
|
export interface RadarNativeInterface {
|
|
3
3
|
initialize: (publishableKey: string, fraud?: boolean) => void;
|
|
4
4
|
setLogLevel: (level: RadarLogLevel) => void;
|
|
@@ -42,6 +42,7 @@ export interface RadarNativeInterface {
|
|
|
42
42
|
geocode: (options: RadarGeocodeOptions) => Promise<RadarAddressCallback>;
|
|
43
43
|
reverseGeocode: (options?: RadarReverseGeocodeOptions) => Promise<RadarAddressCallback>;
|
|
44
44
|
ipGeocode: () => Promise<RadarIPGeocodeCallback>;
|
|
45
|
+
validateAddress: (address: RadarAddress) => Promise<RadarValidateAddressCallback>;
|
|
45
46
|
getDistance: (option: RadarGetDistanceOptions) => Promise<RadarRouteCallback>;
|
|
46
47
|
getMatrix: (option: RadarGetMatrixOptions) => Promise<RadarRouteMatrix>;
|
|
47
48
|
logConversion: (options: RadarLogConversionOptions) => Promise<RadarLogConversionCallback>;
|
package/dist/@types/types.d.ts
CHANGED
|
@@ -365,6 +365,10 @@ export interface RadarGeofence {
|
|
|
365
365
|
geometryRadius?: number;
|
|
366
366
|
geometryCenter?: RadarCoordinate;
|
|
367
367
|
coordinates?: number[][];
|
|
368
|
+
operatingHours?: RadarOperatingHours;
|
|
369
|
+
}
|
|
370
|
+
export interface RadarOperatingHours {
|
|
371
|
+
[day: string]: string[][];
|
|
368
372
|
}
|
|
369
373
|
export interface RadarBeacon {
|
|
370
374
|
_id: string;
|
|
@@ -431,6 +435,15 @@ export interface RadarAddress {
|
|
|
431
435
|
stateCode?: string;
|
|
432
436
|
street?: string;
|
|
433
437
|
unit?: string;
|
|
438
|
+
timeZone?: RadarTimeZone;
|
|
439
|
+
}
|
|
440
|
+
export interface RadarTimeZone {
|
|
441
|
+
id: string;
|
|
442
|
+
name: string;
|
|
443
|
+
code: string;
|
|
444
|
+
currentTime: string;
|
|
445
|
+
utcOffset: number;
|
|
446
|
+
dstOffset: number;
|
|
434
447
|
}
|
|
435
448
|
export type RadarVerificationStatus = "verified" | "partially verified" | "ambiguous" | "unverified";
|
|
436
449
|
export interface RadarRoutes {
|
package/dist/@types/types.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RadarEventVerification = exports.RadarEventConfidence = exports.presetEfficient = exports.presetEfficientAndroid = exports.presetEfficientIOS = exports.presetResponsive = exports.presetResponsiveAndroid = exports.presetResponsiveIOS = exports.presetContinuous = exports.presetContinuousAndroid = exports.presetContinuousIOS = void 0;
|
|
4
4
|
const react_native_1 = require("react-native");
|
|
5
|
+
const platform = react_native_1.Platform.OS;
|
|
5
6
|
exports.presetContinuousIOS = {
|
|
6
7
|
desiredStoppedUpdateInterval: 30,
|
|
7
8
|
desiredMovingUpdateInterval: 30,
|
|
@@ -45,7 +46,7 @@ exports.presetContinuousAndroid = {
|
|
|
45
46
|
startTrackingAfter: undefined,
|
|
46
47
|
stopTrackingAfter: undefined,
|
|
47
48
|
};
|
|
48
|
-
exports.presetContinuous =
|
|
49
|
+
exports.presetContinuous = platform === 'ios' ? exports.presetContinuousIOS : exports.presetContinuousAndroid;
|
|
49
50
|
exports.presetResponsiveIOS = {
|
|
50
51
|
desiredStoppedUpdateInterval: 0,
|
|
51
52
|
desiredMovingUpdateInterval: 150,
|
|
@@ -89,7 +90,7 @@ exports.presetResponsiveAndroid = {
|
|
|
89
90
|
startTrackingAfter: undefined,
|
|
90
91
|
stopTrackingAfter: undefined,
|
|
91
92
|
};
|
|
92
|
-
exports.presetResponsive =
|
|
93
|
+
exports.presetResponsive = platform === 'ios' ? exports.presetResponsiveIOS : exports.presetResponsiveAndroid;
|
|
93
94
|
exports.presetEfficientIOS = {
|
|
94
95
|
desiredStoppedUpdateInterval: 0,
|
|
95
96
|
desiredMovingUpdateInterval: 0,
|
|
@@ -133,7 +134,7 @@ exports.presetEfficientAndroid = {
|
|
|
133
134
|
startTrackingAfter: undefined,
|
|
134
135
|
stopTrackingAfter: undefined,
|
|
135
136
|
};
|
|
136
|
-
exports.presetEfficient =
|
|
137
|
+
exports.presetEfficient = platform === 'ios' ? exports.presetEfficientIOS : exports.presetEfficientAndroid;
|
|
137
138
|
var RadarEventConfidence;
|
|
138
139
|
(function (RadarEventConfidence) {
|
|
139
140
|
RadarEventConfidence[RadarEventConfidence["none"] = 0] = "none";
|
package/dist/index.native.js
CHANGED
|
@@ -67,6 +67,7 @@ const autocomplete = (options) => react_native_1.NativeModules.RNRadar.autocompl
|
|
|
67
67
|
const geocode = (options) => react_native_1.NativeModules.RNRadar.geocode(options);
|
|
68
68
|
const reverseGeocode = (options) => react_native_1.NativeModules.RNRadar.reverseGeocode(options);
|
|
69
69
|
const ipGeocode = () => react_native_1.NativeModules.RNRadar.ipGeocode();
|
|
70
|
+
const validateAddress = (address) => react_native_1.NativeModules.RNRadar.validateAddress(address);
|
|
70
71
|
const getDistance = (options) => react_native_1.NativeModules.RNRadar.getDistance(options);
|
|
71
72
|
const getMatrix = (options) => react_native_1.NativeModules.RNRadar.getMatrix(options);
|
|
72
73
|
const logConversion = (options) => react_native_1.NativeModules.RNRadar.logConversion(options);
|
|
@@ -126,6 +127,7 @@ const Radar = {
|
|
|
126
127
|
geocode,
|
|
127
128
|
reverseGeocode,
|
|
128
129
|
ipGeocode,
|
|
130
|
+
validateAddress,
|
|
129
131
|
getDistance,
|
|
130
132
|
getMatrix,
|
|
131
133
|
logConversion,
|
package/dist/ui/styles.d.ts
CHANGED
|
@@ -1,2 +1,172 @@
|
|
|
1
1
|
export default styles;
|
|
2
|
-
declare
|
|
2
|
+
declare namespace styles {
|
|
3
|
+
namespace container {
|
|
4
|
+
let width: "100%";
|
|
5
|
+
let height: "100%";
|
|
6
|
+
let alignItems: "center";
|
|
7
|
+
let paddingTop: number;
|
|
8
|
+
}
|
|
9
|
+
namespace inputContainer {
|
|
10
|
+
export let flexDirection: "row";
|
|
11
|
+
let alignItems_1: "center";
|
|
12
|
+
export { alignItems_1 as alignItems };
|
|
13
|
+
export let marginHorizontal: number;
|
|
14
|
+
export let backgroundColor: string;
|
|
15
|
+
export let borderRadius: number;
|
|
16
|
+
export let borderColor: string;
|
|
17
|
+
export let borderWidth: number;
|
|
18
|
+
let width_1: "95%";
|
|
19
|
+
export { width_1 as width };
|
|
20
|
+
}
|
|
21
|
+
namespace modalInputContainer {
|
|
22
|
+
let flexDirection_1: "row";
|
|
23
|
+
export { flexDirection_1 as flexDirection };
|
|
24
|
+
let alignItems_2: "center";
|
|
25
|
+
export { alignItems_2 as alignItems };
|
|
26
|
+
let marginHorizontal_1: number;
|
|
27
|
+
export { marginHorizontal_1 as marginHorizontal };
|
|
28
|
+
let backgroundColor_1: string;
|
|
29
|
+
export { backgroundColor_1 as backgroundColor };
|
|
30
|
+
let borderRadius_1: number;
|
|
31
|
+
export { borderRadius_1 as borderRadius };
|
|
32
|
+
let borderColor_1: string;
|
|
33
|
+
export { borderColor_1 as borderColor };
|
|
34
|
+
let borderWidth_1: number;
|
|
35
|
+
export { borderWidth_1 as borderWidth };
|
|
36
|
+
}
|
|
37
|
+
namespace inputIcon {
|
|
38
|
+
export let marginLeft: number;
|
|
39
|
+
let height_1: number;
|
|
40
|
+
export { height_1 as height };
|
|
41
|
+
let width_2: number;
|
|
42
|
+
export { width_2 as width };
|
|
43
|
+
let backgroundColor_2: string;
|
|
44
|
+
export { backgroundColor_2 as backgroundColor };
|
|
45
|
+
}
|
|
46
|
+
namespace closeIcon {
|
|
47
|
+
export let marginRight: number;
|
|
48
|
+
let height_2: number;
|
|
49
|
+
export { height_2 as height };
|
|
50
|
+
let width_3: number;
|
|
51
|
+
export { width_3 as width };
|
|
52
|
+
let backgroundColor_3: string;
|
|
53
|
+
export { backgroundColor_3 as backgroundColor };
|
|
54
|
+
}
|
|
55
|
+
namespace input {
|
|
56
|
+
export let flex: number;
|
|
57
|
+
let backgroundColor_4: string;
|
|
58
|
+
export { backgroundColor_4 as backgroundColor };
|
|
59
|
+
let height_3: number;
|
|
60
|
+
export { height_3 as height };
|
|
61
|
+
export let fontSize: number;
|
|
62
|
+
export let paddingHorizontal: number;
|
|
63
|
+
let borderRadius_2: number;
|
|
64
|
+
export { borderRadius_2 as borderRadius };
|
|
65
|
+
}
|
|
66
|
+
namespace resultListWrapper {
|
|
67
|
+
let width_4: "100%";
|
|
68
|
+
export { width_4 as width };
|
|
69
|
+
export let marginBottom: number;
|
|
70
|
+
let backgroundColor_5: string;
|
|
71
|
+
export { backgroundColor_5 as backgroundColor };
|
|
72
|
+
let borderRadius_3: number;
|
|
73
|
+
export { borderRadius_3 as borderRadius };
|
|
74
|
+
export let paddingVertical: number;
|
|
75
|
+
}
|
|
76
|
+
namespace resultList {
|
|
77
|
+
let width_5: "100%";
|
|
78
|
+
export { width_5 as width };
|
|
79
|
+
}
|
|
80
|
+
namespace resultItem {
|
|
81
|
+
export let paddingRight: number;
|
|
82
|
+
let paddingVertical_1: number;
|
|
83
|
+
export { paddingVertical_1 as paddingVertical };
|
|
84
|
+
let paddingHorizontal_1: number;
|
|
85
|
+
export { paddingHorizontal_1 as paddingHorizontal };
|
|
86
|
+
let fontSize_1: number;
|
|
87
|
+
export { fontSize_1 as fontSize };
|
|
88
|
+
let backgroundColor_6: string;
|
|
89
|
+
export { backgroundColor_6 as backgroundColor };
|
|
90
|
+
}
|
|
91
|
+
namespace addressContainer {
|
|
92
|
+
let flexDirection_2: "row";
|
|
93
|
+
export { flexDirection_2 as flexDirection };
|
|
94
|
+
let alignItems_3: "center";
|
|
95
|
+
export { alignItems_3 as alignItems };
|
|
96
|
+
}
|
|
97
|
+
namespace pinIconContainer {
|
|
98
|
+
let width_6: number;
|
|
99
|
+
export { width_6 as width };
|
|
100
|
+
let marginRight_1: number;
|
|
101
|
+
export { marginRight_1 as marginRight };
|
|
102
|
+
}
|
|
103
|
+
namespace pinIcon {
|
|
104
|
+
let height_4: number;
|
|
105
|
+
export { height_4 as height };
|
|
106
|
+
let width_7: number;
|
|
107
|
+
export { width_7 as width };
|
|
108
|
+
}
|
|
109
|
+
namespace addressTextContainer {
|
|
110
|
+
let flex_1: number;
|
|
111
|
+
export { flex_1 as flex };
|
|
112
|
+
}
|
|
113
|
+
namespace addressText {
|
|
114
|
+
let fontSize_2: number;
|
|
115
|
+
export { fontSize_2 as fontSize };
|
|
116
|
+
export let lineHeight: number;
|
|
117
|
+
export let color: string;
|
|
118
|
+
export let fontWeight: "600";
|
|
119
|
+
}
|
|
120
|
+
namespace addressSubtext {
|
|
121
|
+
let fontSize_3: number;
|
|
122
|
+
export { fontSize_3 as fontSize };
|
|
123
|
+
let color_1: string;
|
|
124
|
+
export { color_1 as color };
|
|
125
|
+
}
|
|
126
|
+
namespace footerContainer {
|
|
127
|
+
let flexDirection_3: "row";
|
|
128
|
+
export { flexDirection_3 as flexDirection };
|
|
129
|
+
let alignItems_4: "center";
|
|
130
|
+
export { alignItems_4 as alignItems };
|
|
131
|
+
let paddingVertical_2: number;
|
|
132
|
+
export { paddingVertical_2 as paddingVertical };
|
|
133
|
+
let marginRight_2: number;
|
|
134
|
+
export { marginRight_2 as marginRight };
|
|
135
|
+
export let alignSelf: "flex-end";
|
|
136
|
+
}
|
|
137
|
+
namespace footerText {
|
|
138
|
+
export let marginTop: number;
|
|
139
|
+
let marginRight_3: number;
|
|
140
|
+
export { marginRight_3 as marginRight };
|
|
141
|
+
let fontSize_4: number;
|
|
142
|
+
export { fontSize_4 as fontSize };
|
|
143
|
+
let color_2: string;
|
|
144
|
+
export { color_2 as color };
|
|
145
|
+
}
|
|
146
|
+
namespace logo {
|
|
147
|
+
let width_8: number;
|
|
148
|
+
export { width_8 as width };
|
|
149
|
+
let height_5: number;
|
|
150
|
+
export { height_5 as height };
|
|
151
|
+
export let resizeMode: "contain";
|
|
152
|
+
}
|
|
153
|
+
namespace mapContainer {
|
|
154
|
+
let flex_2: number;
|
|
155
|
+
export { flex_2 as flex };
|
|
156
|
+
}
|
|
157
|
+
namespace map {
|
|
158
|
+
let flex_3: number;
|
|
159
|
+
export { flex_3 as flex };
|
|
160
|
+
}
|
|
161
|
+
namespace mapLogo {
|
|
162
|
+
export let position: "absolute";
|
|
163
|
+
export let bottom: number;
|
|
164
|
+
export let left: number;
|
|
165
|
+
let width_9: number;
|
|
166
|
+
export { width_9 as width };
|
|
167
|
+
let height_6: number;
|
|
168
|
+
export { height_6 as height };
|
|
169
|
+
let resizeMode_1: "contain";
|
|
170
|
+
export { resizeMode_1 as resizeMode };
|
|
171
|
+
}
|
|
172
|
+
}
|
package/ios/Cartfile.resolved
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
github "radarlabs/radar-sdk-ios" "3.18.
|
|
1
|
+
github "radarlabs/radar-sdk-ios" "3.18.4"
|
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.3" forKey:@"radar-xPlatformSDKVersion"];
|
|
106
106
|
[Radar initializeWithPublishableKey:publishableKey];
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -968,6 +968,33 @@ RCT_EXPORT_METHOD(ipGeocode:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRe
|
|
|
968
968
|
}];
|
|
969
969
|
}
|
|
970
970
|
|
|
971
|
+
RCT_EXPORT_METHOD(validateAddress:(NSDictionary *)addressDict resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
|
|
972
|
+
__block RCTPromiseResolveBlock resolver = resolve;
|
|
973
|
+
__block RCTPromiseRejectBlock rejecter = reject;
|
|
974
|
+
|
|
975
|
+
RadarAddress *address = [RadarAddress addressFromObject:addressDict];
|
|
976
|
+
|
|
977
|
+
if (address == nil) {
|
|
978
|
+
reject([Radar stringForStatus:RadarStatusErrorBadRequest], [Radar stringForStatus:RadarStatusErrorBadRequest], nil);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
[Radar validateAddress:address completionHandler:^(RadarStatus status, RadarAddress * _Nullable address, RadarAddressVerificationStatus verificationStatus) {
|
|
982
|
+
if (status == RadarStatusSuccess && resolver) {
|
|
983
|
+
NSMutableDictionary *dict = [NSMutableDictionary new];
|
|
984
|
+
[dict setObject:[Radar stringForStatus:status] forKey:@"status"];
|
|
985
|
+
if (address) {
|
|
986
|
+
[dict setObject:[address dictionaryValue] forKey:@"address"];
|
|
987
|
+
}
|
|
988
|
+
dict[@"verificationStatus"] = [Radar stringForVerificationStatus: verificationStatus];
|
|
989
|
+
resolver(dict);
|
|
990
|
+
} else if (rejecter) {
|
|
991
|
+
rejecter([Radar stringForStatus:status], [Radar stringForStatus:status], nil);
|
|
992
|
+
}
|
|
993
|
+
resolver = nil;
|
|
994
|
+
rejecter = nil;
|
|
995
|
+
}];
|
|
996
|
+
}
|
|
997
|
+
|
|
971
998
|
RCT_EXPORT_METHOD(getDistance:(NSDictionary *)optionsDict resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
|
|
972
999
|
if (optionsDict == nil) {
|
|
973
1000
|
if (reject) {
|
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.3",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"/android",
|
|
@@ -34,6 +34,9 @@
|
|
|
34
34
|
"modulePathIgnorePatterns": [
|
|
35
35
|
"example",
|
|
36
36
|
"example2"
|
|
37
|
+
],
|
|
38
|
+
"setupFiles": [
|
|
39
|
+
"./test/jest.setup.js"
|
|
37
40
|
]
|
|
38
41
|
},
|
|
39
42
|
"peerDependencies": {
|
|
@@ -65,15 +68,15 @@
|
|
|
65
68
|
"eslint-plugin-jest": "^22.1.2",
|
|
66
69
|
"eslint-plugin-jsx-a11y": "^6.1.1",
|
|
67
70
|
"eslint-plugin-react": "^7.11.1",
|
|
68
|
-
"expo": "^
|
|
69
|
-
"expo-module-scripts": "^3.
|
|
70
|
-
"jest": "^
|
|
71
|
-
"jest-junit": "^
|
|
71
|
+
"expo": "^51.0.0",
|
|
72
|
+
"expo-module-scripts": "^3.5.2",
|
|
73
|
+
"jest": "^29.7.0",
|
|
74
|
+
"jest-junit": "^16.0.0",
|
|
72
75
|
"logkitty": ">=0.7.1",
|
|
73
76
|
"metro-react-native-babel-preset": "^0.51.1",
|
|
74
77
|
"npm-run-all": "^4.1.5",
|
|
75
|
-
"react": "
|
|
76
|
-
"react-native": "0.
|
|
78
|
+
"react": "^18.2.0",
|
|
79
|
+
"react-native": "^0.74.5",
|
|
77
80
|
"typescript": "^5.3.3"
|
|
78
81
|
},
|
|
79
82
|
"bugs": {
|
|
@@ -51,7 +51,8 @@ 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
|
-
|
|
54
|
+
const RadarSDKMotionVersion = '3.18.3';
|
|
55
|
+
if (contents.indexOf(`pod 'RadarSDKMotion', ${RadarSDKMotionVersion}`) === -1) {
|
|
55
56
|
// Find the target block
|
|
56
57
|
const targetRegex = /target '(\w+)' do/g;
|
|
57
58
|
const match = targetRegex.exec(contents);
|
|
@@ -60,7 +61,7 @@ const withRadarIOS = (config, args) => {
|
|
|
60
61
|
const targetEndIndex = contents.indexOf('end', targetStartIndex) + 3;
|
|
61
62
|
// Insert the pod declaration within the target block
|
|
62
63
|
const targetBlock = contents.substring(targetStartIndex, targetEndIndex);
|
|
63
|
-
const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.18.
|
|
64
|
+
const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.18.3'`);
|
|
64
65
|
const newContents = contents.replace(targetBlock, updatedTargetBlock);
|
|
65
66
|
// Write the updated contents back to the Podfile
|
|
66
67
|
await promises_1.default.writeFile(filePath, newContents);
|