react-native-radar 3.21.0-beta.3 → 3.21.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/Radar.podspec +2 -2
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/radar/RadarModuleImpl.java +99 -85
- package/android/src/newarch/java/com/radar/RadarModule.kt +14 -10
- package/android/src/oldarch/java/com/radar/RadarModule.java +11 -6
- package/android/src/oldarch/java/com/radar/RadarOldArchReceiver.java +8 -2
- package/dist/@types/RadarNativeInterface.d.ts +2 -1
- package/dist/@types/types.d.ts +2 -0
- package/dist/@types/types.js +19 -19
- package/dist/NativeRadar.d.ts +4 -3
- package/dist/NativeRadar.js +1 -1
- package/dist/index.js +4 -1
- package/dist/index.native.d.ts +4 -4
- package/dist/index.native.js +90 -248
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/ios/RNRadar.mm +43 -35
- package/package.json +3 -4
- package/src/@types/RadarNativeInterface.ts +18 -17
- package/src/@types/types.ts +38 -32
- package/src/NativeRadar.ts +6 -6
- package/src/index.native.ts +224 -283
- package/src/index.tsx +4 -1
- package/src/version.ts +1 -1
package/Radar.podspec
CHANGED
|
@@ -8,7 +8,7 @@ Pod::Spec.new do |s|
|
|
|
8
8
|
s.summary = package["description"]
|
|
9
9
|
s.homepage = "https://github.com/radarlabs/react-native-radar"
|
|
10
10
|
s.license = package["license"]
|
|
11
|
-
s.authors = "radarlabs"
|
|
11
|
+
s.authors = "radarlabs"
|
|
12
12
|
|
|
13
13
|
s.platforms = { :ios => min_ios_version_supported }
|
|
14
14
|
s.source = { :git => "https://github.com/radarlabs/react-native-radar.git/react-native-radar.git", :tag => "#{s.version}" }
|
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
17
17
|
s.private_header_files = "ios/**/*.h"
|
|
18
18
|
|
|
19
|
-
s.dependency "RadarSDK", "~> 3.21.
|
|
19
|
+
s.dependency "RadarSDK", "~> 3.21.8"
|
|
20
20
|
|
|
21
21
|
install_modules_dependencies(s)
|
|
22
22
|
end
|
package/android/build.gradle
CHANGED
|
@@ -79,10 +79,10 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
79
79
|
dependencies {
|
|
80
80
|
// Expose React Native to consumers of this module
|
|
81
81
|
api "com.facebook.react:react-android"
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
// Keep Kotlin stdlib internal to this module
|
|
84
84
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
api 'io.radar:sdk:3.21.3'
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -52,11 +52,11 @@ public class RadarModuleImpl {
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
private boolean fraud = false;
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
public String getName() {
|
|
57
57
|
return "RNRadar";
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
public void setLogLevel(String level) {
|
|
61
61
|
Radar.RadarLogLevel logLevel = Radar.RadarLogLevel.NONE;
|
|
62
62
|
if (level != null) {
|
|
@@ -73,12 +73,12 @@ public class RadarModuleImpl {
|
|
|
73
73
|
Radar.setLogLevel(logLevel);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
|
|
77
77
|
public void setUserId(String userId) {
|
|
78
78
|
Radar.setUserId(userId);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
|
|
82
82
|
public void getUserId(final Promise promise) {
|
|
83
83
|
if (promise == null) {
|
|
84
84
|
return;
|
|
@@ -87,12 +87,12 @@ public class RadarModuleImpl {
|
|
|
87
87
|
promise.resolve(Radar.getUserId());
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
public void setDescription(String description) {
|
|
92
92
|
Radar.setDescription(description);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
|
|
96
96
|
public void getDescription(final Promise promise) {
|
|
97
97
|
if (promise == null) {
|
|
98
98
|
return;
|
|
@@ -101,7 +101,7 @@ public class RadarModuleImpl {
|
|
|
101
101
|
promise.resolve(Radar.getDescription());
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
|
|
105
105
|
public void nativeSdkVersion(final Promise promise) {
|
|
106
106
|
if (promise == null) {
|
|
107
107
|
return;
|
|
@@ -109,33 +109,46 @@ public class RadarModuleImpl {
|
|
|
109
109
|
String sdkVersion = Radar.sdkVersion();
|
|
110
110
|
|
|
111
111
|
if (sdkVersion != null) {
|
|
112
|
-
promise.resolve(sdkVersion);
|
|
112
|
+
promise.resolve(sdkVersion);
|
|
113
113
|
} else {
|
|
114
114
|
promise.reject(Radar.RadarStatus.ERROR_BAD_REQUEST.toString(), Radar.RadarStatus.ERROR_BAD_REQUEST.toString());
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
public void setMetadata(ReadableMap metadataMap) throws JSONException {
|
|
120
120
|
Radar.setMetadata(RadarUtils.jsonForMap(metadataMap));
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
public void getMetadata(final Promise promise) throws JSONException {
|
|
123
|
+
|
|
124
|
+
public void getMetadata(final Promise promise) throws JSONException {
|
|
125
125
|
if (promise == null) {
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
JSONObject metaJson = Radar.getMetadata();
|
|
129
|
+
JSONObject metaJson = Radar.getMetadata();
|
|
130
130
|
promise.resolve(RadarUtils.mapForJson(metaJson));
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
public void setProduct(String product) {
|
|
134
|
+
Radar.setProduct(product);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
public void getProduct(final Promise promise) throws JSONException {
|
|
138
|
+
if (promise == null) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
String product = Radar.getProduct();
|
|
143
|
+
promise.resolve(product);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
134
147
|
public void setAnonymousTrackingEnabled(boolean enabled) {
|
|
135
148
|
Radar.setAnonymousTrackingEnabled(enabled);
|
|
136
149
|
}
|
|
137
150
|
|
|
138
|
-
|
|
151
|
+
|
|
139
152
|
public void getHost(final Promise promise) {
|
|
140
153
|
if (promise == null) {
|
|
141
154
|
return;
|
|
@@ -144,7 +157,7 @@ public class RadarModuleImpl {
|
|
|
144
157
|
promise.resolve(Radar.getHost());
|
|
145
158
|
}
|
|
146
159
|
|
|
147
|
-
|
|
160
|
+
|
|
148
161
|
public void getPublishableKey(final Promise promise) {
|
|
149
162
|
if (promise == null) {
|
|
150
163
|
return;
|
|
@@ -152,12 +165,12 @@ public class RadarModuleImpl {
|
|
|
152
165
|
|
|
153
166
|
promise.resolve(Radar.getPublishableKey());
|
|
154
167
|
}
|
|
155
|
-
|
|
168
|
+
|
|
156
169
|
public void getLocation(String desiredAccuracy, final Promise promise) {
|
|
157
|
-
|
|
158
|
-
RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy accuracyLevel = RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy.MEDIUM;
|
|
170
|
+
|
|
171
|
+
RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy accuracyLevel = RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy.MEDIUM;
|
|
159
172
|
String accuracy = desiredAccuracy != null ? desiredAccuracy.toLowerCase() : "medium";
|
|
160
|
-
|
|
173
|
+
|
|
161
174
|
if (accuracy.equals("low")) {
|
|
162
175
|
accuracyLevel = RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy.LOW;
|
|
163
176
|
} else if (accuracy.equals("medium")) {
|
|
@@ -169,7 +182,7 @@ public class RadarModuleImpl {
|
|
|
169
182
|
}
|
|
170
183
|
|
|
171
184
|
Radar.getLocation(accuracyLevel, new Radar.RadarLocationCallback() {
|
|
172
|
-
|
|
185
|
+
|
|
173
186
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable Location location, boolean stopped) {
|
|
174
187
|
if (promise == null) {
|
|
175
188
|
return;
|
|
@@ -195,9 +208,9 @@ public class RadarModuleImpl {
|
|
|
195
208
|
});
|
|
196
209
|
}
|
|
197
210
|
|
|
198
|
-
|
|
211
|
+
|
|
199
212
|
public void trackOnce(ReadableMap optionsMap, final Promise promise) {
|
|
200
|
-
|
|
213
|
+
|
|
201
214
|
Location location = null;
|
|
202
215
|
RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy accuracyLevel = RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy.MEDIUM;
|
|
203
216
|
boolean beaconsTrackingOption = false;
|
|
@@ -231,7 +244,7 @@ public class RadarModuleImpl {
|
|
|
231
244
|
}
|
|
232
245
|
|
|
233
246
|
Radar.RadarTrackCallback trackCallback = new Radar.RadarTrackCallback() {
|
|
234
|
-
|
|
247
|
+
|
|
235
248
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable Location location, @Nullable RadarEvent[] events, @Nullable RadarUser user) {
|
|
236
249
|
if (promise == null) {
|
|
237
250
|
return;
|
|
@@ -268,11 +281,13 @@ public class RadarModuleImpl {
|
|
|
268
281
|
}
|
|
269
282
|
}
|
|
270
283
|
|
|
271
|
-
|
|
284
|
+
|
|
272
285
|
public void trackVerified(ReadableMap optionsMap, final Promise promise) {
|
|
273
286
|
|
|
274
287
|
boolean beaconsTrackingOption = false;
|
|
275
288
|
RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy accuracyLevel = RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy.MEDIUM;
|
|
289
|
+
String reason = null;
|
|
290
|
+
String transactionId = null;
|
|
276
291
|
|
|
277
292
|
if (optionsMap != null) {
|
|
278
293
|
if (optionsMap.hasKey("beacons")) {
|
|
@@ -290,10 +305,16 @@ public class RadarModuleImpl {
|
|
|
290
305
|
accuracyLevel = RadarTrackingOptions.RadarTrackingOptionsDesiredAccuracy.HIGH;
|
|
291
306
|
}
|
|
292
307
|
}
|
|
308
|
+
if (optionsMap.hasKey("reason")) {
|
|
309
|
+
reason = optionsMap.getString("reason");
|
|
310
|
+
}
|
|
311
|
+
if (optionsMap.hasKey("transactionId")) {
|
|
312
|
+
transactionId = optionsMap.getString("transactionId");
|
|
313
|
+
}
|
|
293
314
|
}
|
|
294
315
|
|
|
295
316
|
Radar.RadarTrackVerifiedCallback trackCallback = new Radar.RadarTrackVerifiedCallback() {
|
|
296
|
-
|
|
317
|
+
|
|
297
318
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarVerifiedLocationToken token) {
|
|
298
319
|
if (promise == null) {
|
|
299
320
|
return;
|
|
@@ -317,23 +338,17 @@ public class RadarModuleImpl {
|
|
|
317
338
|
}
|
|
318
339
|
};
|
|
319
340
|
|
|
320
|
-
Radar.trackVerified(beaconsTrackingOption, accuracyLevel, trackCallback);
|
|
341
|
+
Radar.trackVerified(beaconsTrackingOption, accuracyLevel, reason, transactionId, trackCallback);
|
|
321
342
|
}
|
|
322
343
|
|
|
323
|
-
|
|
344
|
+
|
|
324
345
|
public void isTrackingVerified(final Promise promise) {
|
|
325
346
|
promise.resolve(Radar.isTrackingVerified());
|
|
326
347
|
}
|
|
327
348
|
|
|
328
|
-
|
|
329
|
-
public void setProduct(String product) {
|
|
330
|
-
Radar.setProduct(product);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
|
|
334
349
|
public void getVerifiedLocationToken(final Promise promise) {
|
|
335
350
|
Radar.RadarTrackVerifiedCallback trackCallback = new Radar.RadarTrackVerifiedCallback() {
|
|
336
|
-
|
|
351
|
+
|
|
337
352
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarVerifiedLocationToken token) {
|
|
338
353
|
if (promise == null) {
|
|
339
354
|
return;
|
|
@@ -360,27 +375,27 @@ public class RadarModuleImpl {
|
|
|
360
375
|
Radar.getVerifiedLocationToken(trackCallback);
|
|
361
376
|
}
|
|
362
377
|
|
|
363
|
-
|
|
378
|
+
|
|
364
379
|
public void clearVerifiedLocationToken() {
|
|
365
380
|
Radar.clearVerifiedLocationToken();
|
|
366
381
|
}
|
|
367
382
|
|
|
368
|
-
|
|
383
|
+
|
|
369
384
|
public void startTrackingEfficient() {
|
|
370
385
|
Radar.startTracking(RadarTrackingOptions.EFFICIENT);
|
|
371
386
|
}
|
|
372
387
|
|
|
373
|
-
|
|
388
|
+
|
|
374
389
|
public void startTrackingResponsive() {
|
|
375
390
|
Radar.startTracking(RadarTrackingOptions.RESPONSIVE);
|
|
376
391
|
}
|
|
377
392
|
|
|
378
|
-
|
|
393
|
+
|
|
379
394
|
public void startTrackingContinuous() {
|
|
380
395
|
Radar.startTracking(RadarTrackingOptions.CONTINUOUS);
|
|
381
396
|
}
|
|
382
397
|
|
|
383
|
-
|
|
398
|
+
|
|
384
399
|
public void startTrackingCustom(ReadableMap optionsMap) {
|
|
385
400
|
try {
|
|
386
401
|
JSONObject optionsObj = RadarUtils.jsonForMap(optionsMap);
|
|
@@ -391,7 +406,7 @@ public class RadarModuleImpl {
|
|
|
391
406
|
}
|
|
392
407
|
}
|
|
393
408
|
|
|
394
|
-
|
|
409
|
+
|
|
395
410
|
public void startTrackingVerified(ReadableMap optionsMap) {
|
|
396
411
|
boolean beacons = false;
|
|
397
412
|
int interval = 1200;
|
|
@@ -404,7 +419,7 @@ public class RadarModuleImpl {
|
|
|
404
419
|
Radar.startTrackingVerified(interval, beacons);
|
|
405
420
|
}
|
|
406
421
|
|
|
407
|
-
|
|
422
|
+
|
|
408
423
|
public void mockTracking(ReadableMap optionsMap) {
|
|
409
424
|
ReadableMap originMap = optionsMap.getMap("origin");
|
|
410
425
|
double originLatitude = originMap.getDouble("latitude");
|
|
@@ -431,24 +446,24 @@ public class RadarModuleImpl {
|
|
|
431
446
|
int interval = optionsMap.hasKey("interval") ? optionsMap.getInt("interval") : 1;
|
|
432
447
|
|
|
433
448
|
Radar.mockTracking(origin, destination, mode, steps, interval, new Radar.RadarTrackCallback() {
|
|
434
|
-
|
|
449
|
+
|
|
435
450
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable Location location, @Nullable RadarEvent[] events, @Nullable RadarUser user) {
|
|
436
451
|
|
|
437
452
|
}
|
|
438
453
|
});
|
|
439
454
|
}
|
|
440
455
|
|
|
441
|
-
|
|
456
|
+
|
|
442
457
|
public void stopTracking() {
|
|
443
458
|
Radar.stopTracking();
|
|
444
459
|
}
|
|
445
460
|
|
|
446
|
-
|
|
461
|
+
|
|
447
462
|
public void stopTrackingVerified() {
|
|
448
463
|
Radar.stopTrackingVerified();
|
|
449
464
|
}
|
|
450
465
|
|
|
451
|
-
|
|
466
|
+
|
|
452
467
|
public void isTracking(final Promise promise) {
|
|
453
468
|
if (promise == null) {
|
|
454
469
|
return;
|
|
@@ -457,7 +472,7 @@ public class RadarModuleImpl {
|
|
|
457
472
|
promise.resolve(Radar.isTracking());
|
|
458
473
|
}
|
|
459
474
|
|
|
460
|
-
|
|
475
|
+
|
|
461
476
|
public void getTrackingOptions(final Promise promise) {
|
|
462
477
|
if (promise == null) {
|
|
463
478
|
return;
|
|
@@ -471,7 +486,7 @@ public class RadarModuleImpl {
|
|
|
471
486
|
}
|
|
472
487
|
}
|
|
473
488
|
|
|
474
|
-
|
|
489
|
+
|
|
475
490
|
public void isUsingRemoteTrackingOptions(final Promise promise) {
|
|
476
491
|
if (promise == null) {
|
|
477
492
|
return;
|
|
@@ -480,7 +495,7 @@ public class RadarModuleImpl {
|
|
|
480
495
|
promise.resolve(Radar.isUsingRemoteTrackingOptions());
|
|
481
496
|
}
|
|
482
497
|
|
|
483
|
-
|
|
498
|
+
|
|
484
499
|
public void setForegroundServiceOptions(ReadableMap optionsMap) {
|
|
485
500
|
try {
|
|
486
501
|
JSONObject optionsObj = RadarUtils.jsonForMap(optionsMap);
|
|
@@ -491,7 +506,7 @@ public class RadarModuleImpl {
|
|
|
491
506
|
}
|
|
492
507
|
}
|
|
493
508
|
|
|
494
|
-
|
|
509
|
+
|
|
495
510
|
public void setNotificationOptions(ReadableMap optionsMap) {
|
|
496
511
|
try {
|
|
497
512
|
JSONObject optionsObj = RadarUtils.jsonForMap(optionsMap);
|
|
@@ -502,17 +517,17 @@ public class RadarModuleImpl {
|
|
|
502
517
|
}
|
|
503
518
|
}
|
|
504
519
|
|
|
505
|
-
|
|
520
|
+
|
|
506
521
|
public void acceptEvent(String eventId, String verifiedPlaceId) {
|
|
507
522
|
Radar.acceptEvent(eventId, verifiedPlaceId);
|
|
508
523
|
}
|
|
509
524
|
|
|
510
|
-
|
|
525
|
+
|
|
511
526
|
public void rejectEvent(String eventId) {
|
|
512
527
|
Radar.rejectEvent(eventId);
|
|
513
528
|
}
|
|
514
529
|
|
|
515
|
-
|
|
530
|
+
|
|
516
531
|
public void getTripOptions(final Promise promise) {
|
|
517
532
|
if (promise == null) {
|
|
518
533
|
return;
|
|
@@ -526,7 +541,7 @@ public class RadarModuleImpl {
|
|
|
526
541
|
}
|
|
527
542
|
}
|
|
528
543
|
|
|
529
|
-
|
|
544
|
+
|
|
530
545
|
public void startTrip(ReadableMap optionsMap, final Promise promise) {
|
|
531
546
|
try {
|
|
532
547
|
JSONObject optionsJson = RadarUtils.jsonForMap(optionsMap);
|
|
@@ -544,7 +559,7 @@ public class RadarModuleImpl {
|
|
|
544
559
|
trackingOptions = RadarTrackingOptions.fromJson(trackingOptionsJson);
|
|
545
560
|
}
|
|
546
561
|
Radar.startTrip(options, trackingOptions, new Radar.RadarTripCallback() {
|
|
547
|
-
|
|
562
|
+
|
|
548
563
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarTrip trip, @Nullable RadarEvent[] events) {
|
|
549
564
|
if (promise == null) {
|
|
550
565
|
return;
|
|
@@ -575,10 +590,10 @@ public class RadarModuleImpl {
|
|
|
575
590
|
}
|
|
576
591
|
}
|
|
577
592
|
|
|
578
|
-
|
|
593
|
+
|
|
579
594
|
public void completeTrip(final Promise promise) {
|
|
580
595
|
Radar.completeTrip(new Radar.RadarTripCallback() {
|
|
581
|
-
|
|
596
|
+
|
|
582
597
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarTrip trip, @Nullable RadarEvent[] events) {
|
|
583
598
|
if (promise == null) {
|
|
584
599
|
return;
|
|
@@ -605,10 +620,10 @@ public class RadarModuleImpl {
|
|
|
605
620
|
});
|
|
606
621
|
}
|
|
607
622
|
|
|
608
|
-
|
|
623
|
+
|
|
609
624
|
public void cancelTrip(final Promise promise) {
|
|
610
625
|
Radar.cancelTrip(new Radar.RadarTripCallback() {
|
|
611
|
-
|
|
626
|
+
|
|
612
627
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarTrip trip, @Nullable RadarEvent[] events) {
|
|
613
628
|
if (promise == null) {
|
|
614
629
|
return;
|
|
@@ -635,7 +650,7 @@ public class RadarModuleImpl {
|
|
|
635
650
|
});
|
|
636
651
|
}
|
|
637
652
|
|
|
638
|
-
|
|
653
|
+
|
|
639
654
|
public void updateTrip(ReadableMap optionsMap, final Promise promise) {
|
|
640
655
|
|
|
641
656
|
try {
|
|
@@ -667,7 +682,7 @@ public class RadarModuleImpl {
|
|
|
667
682
|
}
|
|
668
683
|
|
|
669
684
|
Radar.updateTrip(options, status, new Radar.RadarTripCallback() {
|
|
670
|
-
|
|
685
|
+
|
|
671
686
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarTrip trip, @Nullable RadarEvent[] events) {
|
|
672
687
|
if (promise == null) {
|
|
673
688
|
return;
|
|
@@ -698,14 +713,14 @@ public class RadarModuleImpl {
|
|
|
698
713
|
}
|
|
699
714
|
}
|
|
700
715
|
|
|
701
|
-
|
|
716
|
+
|
|
702
717
|
public void getContext(@Nullable ReadableMap locationMap, final Promise promise) {
|
|
703
718
|
if (promise == null) {
|
|
704
719
|
return;
|
|
705
720
|
}
|
|
706
721
|
|
|
707
722
|
Radar.RadarContextCallback callback = new Radar.RadarContextCallback() {
|
|
708
|
-
|
|
723
|
+
|
|
709
724
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable Location location, @Nullable RadarContext context) {
|
|
710
725
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
711
726
|
try {
|
|
@@ -740,7 +755,7 @@ public class RadarModuleImpl {
|
|
|
740
755
|
}
|
|
741
756
|
}
|
|
742
757
|
|
|
743
|
-
|
|
758
|
+
|
|
744
759
|
public void searchPlaces(ReadableMap optionsMap, final Promise promise) {
|
|
745
760
|
if (promise == null) {
|
|
746
761
|
return;
|
|
@@ -764,7 +779,7 @@ public class RadarModuleImpl {
|
|
|
764
779
|
int limit = optionsMap.hasKey("limit") ? optionsMap.getInt("limit") : 10;
|
|
765
780
|
|
|
766
781
|
Radar.RadarSearchPlacesCallback callback = new Radar.RadarSearchPlacesCallback() {
|
|
767
|
-
|
|
782
|
+
|
|
768
783
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable Location location, @Nullable RadarPlace[] places) {
|
|
769
784
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
770
785
|
try {
|
|
@@ -794,7 +809,7 @@ public class RadarModuleImpl {
|
|
|
794
809
|
}
|
|
795
810
|
}
|
|
796
811
|
|
|
797
|
-
|
|
812
|
+
|
|
798
813
|
public void searchGeofences(ReadableMap optionsMap, final Promise promise) {
|
|
799
814
|
if (promise == null) {
|
|
800
815
|
return;
|
|
@@ -824,10 +839,10 @@ public class RadarModuleImpl {
|
|
|
824
839
|
}
|
|
825
840
|
|
|
826
841
|
int limit = optionsMap.hasKey("limit") ? optionsMap.getInt("limit") : 100;
|
|
827
|
-
boolean includeGeometry = optionsMap.hasKey("includeGeometry") ? optionsMap.getBoolean("includeGeometry") : false;
|
|
842
|
+
boolean includeGeometry = optionsMap.hasKey("includeGeometry") ? optionsMap.getBoolean("includeGeometry") : false;
|
|
828
843
|
|
|
829
844
|
Radar.RadarSearchGeofencesCallback callback = new Radar.RadarSearchGeofencesCallback() {
|
|
830
|
-
|
|
845
|
+
|
|
831
846
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable Location location, @Nullable RadarGeofence[] geofences) {
|
|
832
847
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
833
848
|
try {
|
|
@@ -857,7 +872,7 @@ public class RadarModuleImpl {
|
|
|
857
872
|
}
|
|
858
873
|
}
|
|
859
874
|
|
|
860
|
-
|
|
875
|
+
|
|
861
876
|
public void autocomplete(ReadableMap optionsMap, final Promise promise) {
|
|
862
877
|
if (promise == null) {
|
|
863
878
|
return;
|
|
@@ -895,7 +910,7 @@ public class RadarModuleImpl {
|
|
|
895
910
|
boolean mailable = optionsMap.hasKey("mailable") ? optionsMap.getBoolean("mailable") : false;
|
|
896
911
|
|
|
897
912
|
Radar.autocomplete(query, near, layers, limit, country, true, mailable, new Radar.RadarGeocodeCallback() {
|
|
898
|
-
|
|
913
|
+
|
|
899
914
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarAddress[] addresses) {
|
|
900
915
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
901
916
|
try {
|
|
@@ -916,7 +931,7 @@ public class RadarModuleImpl {
|
|
|
916
931
|
});
|
|
917
932
|
}
|
|
918
933
|
|
|
919
|
-
|
|
934
|
+
|
|
920
935
|
public void geocode(ReadableMap optionsMap, final Promise promise) {
|
|
921
936
|
if (promise == null) {
|
|
922
937
|
return;
|
|
@@ -933,7 +948,7 @@ public class RadarModuleImpl {
|
|
|
933
948
|
String[] countries = optionsMap.hasKey("countries") ? RadarUtils.stringArrayForArray(optionsMap.getArray("countries")) : null;
|
|
934
949
|
|
|
935
950
|
Radar.geocode(address, layers, countries, new Radar.RadarGeocodeCallback() {
|
|
936
|
-
|
|
951
|
+
|
|
937
952
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarAddress[] addresses) {
|
|
938
953
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
939
954
|
try {
|
|
@@ -954,7 +969,7 @@ public class RadarModuleImpl {
|
|
|
954
969
|
});
|
|
955
970
|
}
|
|
956
971
|
|
|
957
|
-
|
|
972
|
+
|
|
958
973
|
public void reverseGeocode(ReadableMap optionsMap, final Promise promise) {
|
|
959
974
|
if (promise == null) {
|
|
960
975
|
return;
|
|
@@ -969,7 +984,7 @@ public class RadarModuleImpl {
|
|
|
969
984
|
}
|
|
970
985
|
|
|
971
986
|
Radar.RadarGeocodeCallback callback = new Radar.RadarGeocodeCallback() {
|
|
972
|
-
|
|
987
|
+
|
|
973
988
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarAddress[] addresses) {
|
|
974
989
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
975
990
|
try {
|
|
@@ -1002,14 +1017,14 @@ public class RadarModuleImpl {
|
|
|
1002
1017
|
}
|
|
1003
1018
|
}
|
|
1004
1019
|
|
|
1005
|
-
|
|
1020
|
+
|
|
1006
1021
|
public void ipGeocode(final Promise promise) {
|
|
1007
1022
|
if (promise == null) {
|
|
1008
1023
|
return;
|
|
1009
1024
|
}
|
|
1010
1025
|
|
|
1011
1026
|
Radar.ipGeocode(new Radar.RadarIpGeocodeCallback() {
|
|
1012
|
-
|
|
1027
|
+
|
|
1013
1028
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarAddress address, boolean proxy) {
|
|
1014
1029
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
1015
1030
|
try {
|
|
@@ -1031,7 +1046,7 @@ public class RadarModuleImpl {
|
|
|
1031
1046
|
});
|
|
1032
1047
|
}
|
|
1033
1048
|
|
|
1034
|
-
|
|
1049
|
+
|
|
1035
1050
|
public void validateAddress(ReadableMap addressMap, final Promise promise) {
|
|
1036
1051
|
if (promise == null) {
|
|
1037
1052
|
return;
|
|
@@ -1045,7 +1060,7 @@ public class RadarModuleImpl {
|
|
|
1045
1060
|
return;
|
|
1046
1061
|
}
|
|
1047
1062
|
Radar.validateAddress(address, new Radar.RadarValidateAddressCallback() {
|
|
1048
|
-
|
|
1063
|
+
|
|
1049
1064
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarAddress address, @Nullable Radar.RadarAddressVerificationStatus verificationStatus) {
|
|
1050
1065
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
1051
1066
|
try {
|
|
@@ -1069,7 +1084,7 @@ public class RadarModuleImpl {
|
|
|
1069
1084
|
});
|
|
1070
1085
|
}
|
|
1071
1086
|
|
|
1072
|
-
|
|
1087
|
+
|
|
1073
1088
|
public void getDistance(ReadableMap optionsMap, final Promise promise) {
|
|
1074
1089
|
if (promise == null) {
|
|
1075
1090
|
return;
|
|
@@ -1113,7 +1128,7 @@ public class RadarModuleImpl {
|
|
|
1113
1128
|
Radar.RadarRouteUnits units = unitsStr != null && (unitsStr.equals("METRIC") || unitsStr.equals("metric")) ? Radar.RadarRouteUnits.METRIC : Radar.RadarRouteUnits.IMPERIAL;
|
|
1114
1129
|
|
|
1115
1130
|
Radar.RadarRouteCallback callback = new Radar.RadarRouteCallback() {
|
|
1116
|
-
|
|
1131
|
+
|
|
1117
1132
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarRoutes routes) {
|
|
1118
1133
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
1119
1134
|
try {
|
|
@@ -1140,7 +1155,7 @@ public class RadarModuleImpl {
|
|
|
1140
1155
|
}
|
|
1141
1156
|
}
|
|
1142
1157
|
|
|
1143
|
-
|
|
1158
|
+
|
|
1144
1159
|
public void getMatrix(ReadableMap optionsMap, final Promise promise) {
|
|
1145
1160
|
if (promise == null) {
|
|
1146
1161
|
return;
|
|
@@ -1187,7 +1202,7 @@ public class RadarModuleImpl {
|
|
|
1187
1202
|
Radar.RadarRouteUnits units = unitsStr != null && (unitsStr.equals("METRIC") || unitsStr.equals("metric")) ? Radar.RadarRouteUnits.METRIC : Radar.RadarRouteUnits.IMPERIAL;
|
|
1188
1203
|
|
|
1189
1204
|
Radar.getMatrix(origins, destinations, mode, units, new Radar.RadarMatrixCallback() {
|
|
1190
|
-
|
|
1205
|
+
|
|
1191
1206
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarRouteMatrix matrix) {
|
|
1192
1207
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
1193
1208
|
try {
|
|
@@ -1208,7 +1223,7 @@ public class RadarModuleImpl {
|
|
|
1208
1223
|
});
|
|
1209
1224
|
}
|
|
1210
1225
|
|
|
1211
|
-
|
|
1226
|
+
|
|
1212
1227
|
public void logConversion(ReadableMap optionsMap, final Promise promise) throws JSONException {
|
|
1213
1228
|
if (promise == null) {
|
|
1214
1229
|
return;
|
|
@@ -1223,10 +1238,10 @@ public class RadarModuleImpl {
|
|
|
1223
1238
|
String name = optionsMap.getString("name");
|
|
1224
1239
|
Double revenue = optionsMap.hasKey("revenue") ? new Double(optionsMap.getDouble("revenue")) : null;
|
|
1225
1240
|
ReadableMap metadata = optionsMap.hasKey("metadata") ? optionsMap.getMap("metadata") : null;
|
|
1226
|
-
|
|
1241
|
+
|
|
1227
1242
|
JSONObject metadataObj = RadarUtils.jsonForMap(metadata);
|
|
1228
1243
|
Radar.RadarLogConversionCallback callback = new Radar.RadarLogConversionCallback() {
|
|
1229
|
-
|
|
1244
|
+
|
|
1230
1245
|
public void onComplete(@NonNull Radar.RadarStatus status, @Nullable RadarEvent event) {
|
|
1231
1246
|
try {
|
|
1232
1247
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
@@ -1253,4 +1268,3 @@ public class RadarModuleImpl {
|
|
|
1253
1268
|
}
|
|
1254
1269
|
}
|
|
1255
1270
|
}
|
|
1256
|
-
|