react-native-radar 3.19.0 → 3.20.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.
@@ -18,7 +18,7 @@ android {
18
18
  minSdkVersion 16
19
19
  targetSdkVersion 31
20
20
  versionCode 1
21
- versionName '3.19.0'
21
+ versionName '3.20.0'
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.19.0'
48
+ api 'io.radar:sdk:3.21.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.19.0");
99
+ editor.putString("x_platform_sdk_version", "3.20.0");
100
100
  editor.apply();
101
101
  if (fraud) {
102
102
  Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud);
@@ -431,6 +431,16 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
431
431
  Radar.trackVerified(beaconsTrackingOption, accuracyLevel, trackCallback);
432
432
  }
433
433
 
434
+ @ReactMethod
435
+ public void isTrackingVerified(final Promise promise) {
436
+ promise.resolve(Radar.isTrackingVerified());
437
+ }
438
+
439
+ @ReactMethod
440
+ public void setProduct(String product) {
441
+ Radar.setProduct(product);
442
+ }
443
+
434
444
  @ReactMethod
435
445
  public void getVerifiedLocationToken(final Promise promise) {
436
446
  Radar.RadarTrackVerifiedCallback trackCallback = new Radar.RadarTrackVerifiedCallback() {
@@ -861,6 +871,7 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
861
871
  Map<String, String> chainMetadata = RNRadarUtils.stringStringMap(optionsMap.getMap("chainMetadata"));
862
872
  String[] categories = optionsMap.hasKey("categories") ? RNRadarUtils.stringArrayForArray(optionsMap.getArray("categories")) : null;
863
873
  String[] groups = optionsMap.hasKey("groups") ? RNRadarUtils.stringArrayForArray(optionsMap.getArray("groups")) : null;
874
+ String[] countryCodes = optionsMap.hasKey("countryCodes") ? RNRadarUtils.stringArrayForArray(optionsMap.getArray("countryCodes")) : null;
864
875
  int limit = optionsMap.hasKey("limit") ? optionsMap.getInt("limit") : 10;
865
876
 
866
877
  Radar.RadarSearchPlacesCallback callback = new Radar.RadarSearchPlacesCallback() {
@@ -888,9 +899,9 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
888
899
  };
889
900
 
890
901
  if (near != null) {
891
- Radar.searchPlaces(near, radius, chains, chainMetadata, categories, groups, limit, callback);
902
+ Radar.searchPlaces(near, radius, chains, chainMetadata, categories, groups, countryCodes, limit, callback);
892
903
  } else {
893
- Radar.searchPlaces(radius, chains, chainMetadata, categories, groups, limit, callback);
904
+ Radar.searchPlaces(radius, chains, chainMetadata, categories, groups, countryCodes, limit, callback);
894
905
  }
895
906
  }
896
907
 
@@ -21,6 +21,8 @@ export interface RadarNativeInterface {
21
21
  startTrackingContinuous: () => void;
22
22
  startTrackingCustom: (options: RadarTrackingOptions) => void;
23
23
  startTrackingVerified: (options?: RadarVerifiedTrackingOptions) => void;
24
+ isTrackingVerified: () => Promise<boolean>;
25
+ setProduct(product: string): void;
24
26
  mockTracking: (options: RadarMockTrackingOptions) => void;
25
27
  stopTracking: () => void;
26
28
  stopTrackingVerified: () => void;
@@ -111,6 +111,7 @@ export interface RadarSearchPlacesOptions {
111
111
  chainMetadata?: RadarMetadata;
112
112
  categories?: string[];
113
113
  groups?: string[];
114
+ countryCodes?: string[];
114
115
  limit?: number;
115
116
  }
116
117
  export interface RadarAutocompleteOptions {
@@ -50,6 +50,8 @@ const mockTracking = (options) => react_native_1.NativeModules.RNRadar.mockTrack
50
50
  const stopTracking = () => react_native_1.NativeModules.RNRadar.stopTracking();
51
51
  const stopTrackingVerified = () => react_native_1.NativeModules.RNRadar.stopTrackingVerified();
52
52
  const isTracking = () => react_native_1.NativeModules.RNRadar.isTracking();
53
+ const isTrackingVerified = () => react_native_1.NativeModules.RNRadar.isTrackingVerified();
54
+ const setProduct = (product) => react_native_1.NativeModules.RNRadar.setProduct(product);
53
55
  const getTrackingOptions = () => react_native_1.NativeModules.RNRadar.getTrackingOptions();
54
56
  const isUsingRemoteTrackingOptions = () => react_native_1.NativeModules.RNRadar.isUsingRemoteTrackingOptions();
55
57
  const setForegroundServiceOptions = (options) => react_native_1.NativeModules.RNRadar.setForegroundServiceOptions(options);
@@ -100,6 +102,8 @@ const Radar = {
100
102
  getLocation,
101
103
  trackOnce,
102
104
  trackVerified,
105
+ isTrackingVerified,
106
+ setProduct,
103
107
  getVerifiedLocationToken,
104
108
  clearVerifiedLocationToken,
105
109
  startTrackingEfficient,
@@ -1 +1 @@
1
- github "radarlabs/radar-sdk-ios" "3.19.4"
1
+ github "radarlabs/radar-sdk-ios" "3.21.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.19.0" forKey:@"radar-xPlatformSDKVersion"];
105
+ [[NSUserDefaults standardUserDefaults] setObject:@"3.20.0" forKey:@"radar-xPlatformSDKVersion"];
106
106
  [Radar initializeWithPublishableKey:publishableKey];
107
107
  }
108
108
 
@@ -349,6 +349,15 @@ RCT_EXPORT_METHOD(trackVerified:(NSDictionary *)optionsDict resolve:(RCTPromiseR
349
349
  [Radar trackVerifiedWithBeacons:beacons desiredAccuracy:desiredAccuracy completionHandler:completionHandler];
350
350
  }
351
351
 
352
+ RCT_EXPORT_METHOD(isTrackingVerified:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
353
+ BOOL res = [Radar isTrackingVerified];
354
+ resolve(@(res));
355
+ }
356
+
357
+ RCT_EXPORT_METHOD(setProduct:(NSString *)product) {
358
+ [Radar setProduct:product];
359
+ }
360
+
352
361
  RCT_EXPORT_METHOD(getVerifiedLocationToken:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
353
362
  __block RCTPromiseResolveBlock resolver = resolve;
354
363
  __block RCTPromiseRejectBlock rejecter = reject;
@@ -720,6 +729,7 @@ RCT_EXPORT_METHOD(searchPlaces:(NSDictionary *)optionsDict resolve:(RCTPromiseRe
720
729
  NSDictionary *chainMetadata = optionsDict[@"chainMetadata"];
721
730
  NSArray *categories = optionsDict[@"categories"];
722
731
  NSArray *groups = optionsDict[@"groups"];
732
+ NSArray *countryCodes = optionsDict[@"countryCodes"];
723
733
  NSNumber *limitNumber = optionsDict[@"limit"];
724
734
  int limit;
725
735
  if (limitNumber != nil && [limitNumber isKindOfClass:[NSNumber class]]) {
@@ -750,9 +760,9 @@ RCT_EXPORT_METHOD(searchPlaces:(NSDictionary *)optionsDict resolve:(RCTPromiseRe
750
760
  };
751
761
 
752
762
  if (near) {
753
- [Radar searchPlacesNear:near radius:radius chains:chains chainMetadata:chainMetadata categories:categories groups:groups limit:limit completionHandler:completionHandler];
763
+ [Radar searchPlacesNear:near radius:radius chains:chains chainMetadata:chainMetadata categories:categories groups:groups countryCodes:countryCodes limit:limit completionHandler:completionHandler];
754
764
  } else {
755
- [Radar searchPlacesWithRadius:radius chains:chains chainMetadata:chainMetadata categories:categories groups:groups limit:limit completionHandler:completionHandler];
765
+ [Radar searchPlacesWithRadius:radius chains:chains chainMetadata:chainMetadata categories:categories groups:groups countryCodes:countryCodes limit:limit completionHandler:completionHandler];
756
766
  }
757
767
  }
758
768
 
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.19.0",
6
+ "version": "3.20.0",
7
7
  "main": "dist/index.js",
8
8
  "files": [
9
9
  "/android",
@@ -51,7 +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
- if (contents.indexOf("pod 'RadarSDKMotion', '3.19.4'") === -1) {
54
+ if (contents.indexOf("pod 'RadarSDKMotion', '3.21.1'") === -1) {
55
55
  // Find the target block
56
56
  const targetRegex = /target '(\w+)' do/g;
57
57
  const match = targetRegex.exec(contents);
@@ -60,7 +60,7 @@ const withRadarIOS = (config, args) => {
60
60
  const targetEndIndex = contents.indexOf('end', targetStartIndex) + 3;
61
61
  // Insert the pod declaration within the target block
62
62
  const targetBlock = contents.substring(targetStartIndex, targetEndIndex);
63
- const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.19.4'`);
63
+ const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.21.1'`);
64
64
  const newContents = contents.replace(targetBlock, updatedTargetBlock);
65
65
  // Write the updated contents back to the Podfile
66
66
  await promises_1.default.writeFile(filePath, newContents);
@@ -15,5 +15,5 @@ Pod::Spec.new do |s|
15
15
  s.platform = :ios, "10.0"
16
16
 
17
17
  s.dependency "React"
18
- s.dependency "RadarSDK", "~> 3.20.0"
18
+ s.dependency "RadarSDK", "~> 3.21.1"
19
19
  end