react-native-radar 3.12.0 → 3.12.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 +19 -4
- package/dist/package.json +1 -1
- package/dist/src/@types/RadarNativeInterface.d.ts +2 -1
- package/dist/src/@types/types.d.ts +2 -0
- package/dist/src/index.native.js +2 -0
- package/ios/Cartfile.resolved +1 -1
- package/ios/RNRadar.m +17 -12
- package/package.json +1 -1
- package/react-native-radar.podspec +1 -1
- package/src/@types/RadarNativeInterface.ts +2 -1
- package/src/@types/types.ts +2 -0
- package/src/index.native.ts +4 -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.12.
|
|
21
|
+
versionName '3.12.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.13.
|
|
48
|
+
api 'io.radar:sdk:3.13.2'
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -97,7 +97,7 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
97
97
|
this.fraud = fraud;
|
|
98
98
|
SharedPreferences.Editor editor = getReactApplicationContext().getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit();
|
|
99
99
|
editor.putString("x_platform_sdk_type", "ReactNative");
|
|
100
|
-
editor.putString("x_platform_sdk_version", "3.12.
|
|
100
|
+
editor.putString("x_platform_sdk_version", "3.12.2");
|
|
101
101
|
editor.apply();
|
|
102
102
|
if (fraud) {
|
|
103
103
|
Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud);
|
|
@@ -398,7 +398,12 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
398
398
|
|
|
399
399
|
try {
|
|
400
400
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
401
|
-
|
|
401
|
+
WritableMap map = Arguments.createMap();
|
|
402
|
+
map.putString("status", status.toString());
|
|
403
|
+
if (token != null) {
|
|
404
|
+
map.putMap("token", RNRadarUtils.mapForJson(token.toJson()));
|
|
405
|
+
}
|
|
406
|
+
promise.resolve(map);
|
|
402
407
|
} else {
|
|
403
408
|
promise.reject(status.toString(), status.toString());
|
|
404
409
|
}
|
|
@@ -423,7 +428,12 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
423
428
|
|
|
424
429
|
try {
|
|
425
430
|
if (status == Radar.RadarStatus.SUCCESS) {
|
|
426
|
-
|
|
431
|
+
WritableMap map = Arguments.createMap();
|
|
432
|
+
map.putString("status", status.toString());
|
|
433
|
+
if (token != null) {
|
|
434
|
+
map.putMap("token", RNRadarUtils.mapForJson(token.toJson()));
|
|
435
|
+
}
|
|
436
|
+
promise.resolve(map);
|
|
427
437
|
} else {
|
|
428
438
|
promise.reject(status.toString(), status.toString());
|
|
429
439
|
}
|
|
@@ -466,7 +476,7 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
466
476
|
@ReactMethod
|
|
467
477
|
public void startTrackingVerified(ReadableMap optionsMap) {
|
|
468
478
|
boolean beacons = false;
|
|
469
|
-
int interval =
|
|
479
|
+
int interval = 1200;
|
|
470
480
|
|
|
471
481
|
if (optionsMap != null) {
|
|
472
482
|
beacons = optionsMap.hasKey("beacons") ? optionsMap.getBoolean("beacons") : beacons;
|
|
@@ -515,6 +525,11 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
|
|
|
515
525
|
Radar.stopTracking();
|
|
516
526
|
}
|
|
517
527
|
|
|
528
|
+
@ReactMethod
|
|
529
|
+
public void stopTrackingVerified() {
|
|
530
|
+
Radar.stopTrackingVerified();
|
|
531
|
+
}
|
|
532
|
+
|
|
518
533
|
@ReactMethod
|
|
519
534
|
public void isTracking(final Promise promise) {
|
|
520
535
|
if (promise == null) {
|
package/dist/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.12.
|
|
6
|
+
"version": "3.12.2",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"android",
|
|
@@ -22,9 +22,10 @@ export interface RadarNativeInterface {
|
|
|
22
22
|
startTrackingVerified: (options?: RadarVerifiedTrackingOptions) => void;
|
|
23
23
|
mockTracking: (options: RadarMockTrackingOptions) => void;
|
|
24
24
|
stopTracking: () => void;
|
|
25
|
+
stopTrackingVerified: () => void;
|
|
25
26
|
getTrackingOptions: () => Promise<RadarTrackingOptions>;
|
|
26
27
|
isUsingRemoteTrackingOptions: () => Promise<boolean>;
|
|
27
|
-
isTracking: () => boolean
|
|
28
|
+
isTracking: () => Promise<boolean>;
|
|
28
29
|
setForegroundServiceOptions: (options: RadarTrackingOptionsForegroundService) => void;
|
|
29
30
|
setNotificationOptions: (options: RadarNotificationOptions) => void;
|
|
30
31
|
getTripOptions: () => Promise<RadarTripOptions>;
|
|
@@ -474,6 +474,8 @@ export interface RadarFraud {
|
|
|
474
474
|
compromised: boolean;
|
|
475
475
|
jumped: boolean;
|
|
476
476
|
inaccurate: boolean;
|
|
477
|
+
blocked: boolean;
|
|
478
|
+
sharing: boolean;
|
|
477
479
|
}
|
|
478
480
|
export type RadarTrackingOptionsReplay = "all" | "stops" | "none";
|
|
479
481
|
export type RadarTrackingOptionsSync = "none" | "stopsAndExits" | "all";
|
package/dist/src/index.native.js
CHANGED
|
@@ -47,6 +47,7 @@ const startTrackingCustom = (options) => react_native_1.NativeModules.RNRadar.st
|
|
|
47
47
|
const startTrackingVerified = (options) => react_native_1.NativeModules.RNRadar.startTrackingVerified(options);
|
|
48
48
|
const mockTracking = (options) => react_native_1.NativeModules.RNRadar.mockTracking(options);
|
|
49
49
|
const stopTracking = () => react_native_1.NativeModules.RNRadar.stopTracking();
|
|
50
|
+
const stopTrackingVerified = () => react_native_1.NativeModules.RNRadar.stopTracking();
|
|
50
51
|
const getTrackingOptions = () => react_native_1.NativeModules.RNRadar.getTrackingOptions();
|
|
51
52
|
const isUsingRemoteTrackingOptions = () => react_native_1.NativeModules.RNRadar.isUsingRemoteTrackingOptions();
|
|
52
53
|
const isTracking = () => react_native_1.NativeModules.RNRadar.isTracking();
|
|
@@ -106,6 +107,7 @@ const Radar = {
|
|
|
106
107
|
startTrackingVerified,
|
|
107
108
|
mockTracking,
|
|
108
109
|
stopTracking,
|
|
110
|
+
stopTrackingVerified,
|
|
109
111
|
isTracking,
|
|
110
112
|
getTrackingOptions,
|
|
111
113
|
setForegroundServiceOptions,
|
package/ios/Cartfile.resolved
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
github "radarlabs/radar-sdk-ios" "3.13.
|
|
1
|
+
github "radarlabs/radar-sdk-ios" "3.13.5"
|
package/ios/RNRadar.m
CHANGED
|
@@ -24,6 +24,9 @@ RCT_EXPORT_MODULE();
|
|
|
24
24
|
return self;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
map iOS status string which is PascalCase into standard UPPER_SNAKE_CASE, which is consistent with android and javascript styling.
|
|
29
|
+
*/
|
|
27
30
|
+ (NSDictionary *)mapLocationPermissionStatus:(NSDictionary *)status {
|
|
28
31
|
NSString *statusString = status[@"locationPermissionState"];
|
|
29
32
|
NSString *newStatusString;
|
|
@@ -137,7 +140,7 @@ RCT_EXPORT_MODULE();
|
|
|
137
140
|
|
|
138
141
|
RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud) {
|
|
139
142
|
[[NSUserDefaults standardUserDefaults] setObject:@"ReactNative" forKey:@"radar-xPlatformSDKType"];
|
|
140
|
-
[[NSUserDefaults standardUserDefaults] setObject:@"3.12.
|
|
143
|
+
[[NSUserDefaults standardUserDefaults] setObject:@"3.12.2" forKey:@"radar-xPlatformSDKVersion"];
|
|
141
144
|
[Radar initializeWithPublishableKey:publishableKey];
|
|
142
145
|
}
|
|
143
146
|
|
|
@@ -354,11 +357,12 @@ RCT_EXPORT_METHOD(trackVerified:(NSDictionary *)optionsDict resolve:(RCTPromiseR
|
|
|
354
357
|
|
|
355
358
|
RadarTrackVerifiedCompletionHandler completionHandler = ^(RadarStatus status, RadarVerifiedLocationToken * _Nullable token) {
|
|
356
359
|
if (status == RadarStatusSuccess && resolver) {
|
|
360
|
+
NSMutableDictionary *dict = [NSMutableDictionary new];
|
|
361
|
+
[dict setObject:[Radar stringForStatus:status] forKey:@"status"];
|
|
357
362
|
if (token != nil) {
|
|
358
|
-
|
|
359
|
-
} else {
|
|
360
|
-
resolver(nil);
|
|
363
|
+
[dict setObject:[RNRadar mapLocationPermissionStatus:[token dictionaryValue]] forKey:@"token"];
|
|
361
364
|
}
|
|
365
|
+
resolver(dict);
|
|
362
366
|
} else if (rejecter) {
|
|
363
367
|
rejecter([Radar stringForStatus:status], [Radar stringForStatus:status], nil);
|
|
364
368
|
}
|
|
@@ -375,11 +379,12 @@ RCT_EXPORT_METHOD(getVerifiedLocationToken:(RCTPromiseResolveBlock)resolve rejec
|
|
|
375
379
|
|
|
376
380
|
RadarTrackVerifiedCompletionHandler completionHandler = ^(RadarStatus status, RadarVerifiedLocationToken * _Nullable token) {
|
|
377
381
|
if (status == RadarStatusSuccess && resolver) {
|
|
382
|
+
NSMutableDictionary *dict = [NSMutableDictionary new];
|
|
383
|
+
[dict setObject:[Radar stringForStatus:status] forKey:@"status"];
|
|
378
384
|
if (token != nil) {
|
|
379
|
-
|
|
380
|
-
} else {
|
|
381
|
-
resolver(nil);
|
|
385
|
+
[dict setObject:[token dictionaryValue] forKey:@"token"];
|
|
382
386
|
}
|
|
387
|
+
resolver(dict);
|
|
383
388
|
} else if (rejecter) {
|
|
384
389
|
rejecter([Radar stringForStatus:status], [Radar stringForStatus:status], nil);
|
|
385
390
|
}
|
|
@@ -410,13 +415,9 @@ RCT_EXPORT_METHOD(startTrackingCustom:(NSDictionary *)optionsDict) {
|
|
|
410
415
|
RCT_EXPORT_METHOD(startTrackingVerified:(NSDictionary *)optionsDict) {
|
|
411
416
|
BOOL token = NO;
|
|
412
417
|
BOOL beacons = NO;
|
|
413
|
-
double interval =
|
|
418
|
+
double interval = 1200;
|
|
414
419
|
|
|
415
420
|
if (optionsDict != nil) {
|
|
416
|
-
NSNumber *tokenNumber = optionsDict[@"token"];
|
|
417
|
-
if (tokenNumber != nil && [tokenNumber isKindOfClass:[NSNumber class]]) {
|
|
418
|
-
token = [tokenNumber boolValue];
|
|
419
|
-
}
|
|
420
421
|
NSNumber *beaconsNumber = optionsDict[@"beacons"];
|
|
421
422
|
if (beaconsNumber != nil && [beaconsNumber isKindOfClass:[NSNumber class]]) {
|
|
422
423
|
beacons = [beaconsNumber boolValue];
|
|
@@ -474,6 +475,10 @@ RCT_EXPORT_METHOD(stopTracking) {
|
|
|
474
475
|
[Radar stopTracking];
|
|
475
476
|
}
|
|
476
477
|
|
|
478
|
+
RCT_EXPORT_METHOD(stopTrackingVerified) {
|
|
479
|
+
[Radar stopTrackingVerified];
|
|
480
|
+
}
|
|
481
|
+
|
|
477
482
|
RCT_EXPORT_METHOD(isTracking:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
|
|
478
483
|
BOOL res = [Radar isTracking];
|
|
479
484
|
resolve(@(res));
|
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.12.
|
|
6
|
+
"version": "3.12.2",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"android",
|
|
@@ -66,9 +66,10 @@ export interface RadarNativeInterface {
|
|
|
66
66
|
startTrackingVerified: (options?: RadarVerifiedTrackingOptions) => void;
|
|
67
67
|
mockTracking: (options: RadarMockTrackingOptions) => void;
|
|
68
68
|
stopTracking: () => void;
|
|
69
|
+
stopTrackingVerified: () => void;
|
|
69
70
|
getTrackingOptions: () => Promise<RadarTrackingOptions>;
|
|
70
71
|
isUsingRemoteTrackingOptions: () => Promise<boolean>;
|
|
71
|
-
isTracking: () => boolean
|
|
72
|
+
isTracking: () => Promise<boolean>;
|
|
72
73
|
setForegroundServiceOptions: (
|
|
73
74
|
options: RadarTrackingOptionsForegroundService
|
|
74
75
|
) => void;
|
package/src/@types/types.ts
CHANGED
package/src/index.native.ts
CHANGED
|
@@ -134,13 +134,15 @@ const mockTracking = (options: RadarMockTrackingOptions): void =>
|
|
|
134
134
|
|
|
135
135
|
const stopTracking = (): void => NativeModules.RNRadar.stopTracking();
|
|
136
136
|
|
|
137
|
+
const stopTrackingVerified = (): void => NativeModules.RNRadar.stopTracking();
|
|
138
|
+
|
|
137
139
|
const getTrackingOptions = (): Promise<RadarTrackingOptions> =>
|
|
138
140
|
NativeModules.RNRadar.getTrackingOptions();
|
|
139
141
|
|
|
140
142
|
const isUsingRemoteTrackingOptions = (): Promise<boolean> =>
|
|
141
143
|
NativeModules.RNRadar.isUsingRemoteTrackingOptions();
|
|
142
144
|
|
|
143
|
-
const isTracking = (): boolean => NativeModules.RNRadar.isTracking();
|
|
145
|
+
const isTracking = (): Promise<boolean> => NativeModules.RNRadar.isTracking();
|
|
144
146
|
|
|
145
147
|
const setForegroundServiceOptions = (
|
|
146
148
|
options: RadarTrackingOptionsForegroundService
|
|
@@ -254,6 +256,7 @@ const Radar: RadarNativeInterface = {
|
|
|
254
256
|
startTrackingVerified,
|
|
255
257
|
mockTracking,
|
|
256
258
|
stopTracking,
|
|
259
|
+
stopTrackingVerified,
|
|
257
260
|
isTracking,
|
|
258
261
|
getTrackingOptions,
|
|
259
262
|
setForegroundServiceOptions,
|