react-native-radar 3.18.1-beta.1 → 3.18.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.
@@ -18,7 +18,7 @@ android {
18
18
  minSdkVersion 16
19
19
  targetSdkVersion 31
20
20
  versionCode 1
21
- versionName '3.18.1-beta.1'
21
+ versionName '3.18.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.0'
48
+ api 'io.radar:sdk:3.18.3'
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.1-beta.1");
99
+ editor.putString("x_platform_sdk_version", "3.18.2");
100
100
  editor.apply();
101
101
  if (fraud) {
102
102
  Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud);
@@ -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.getContext(new Radar.RadarContextCallback() {
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
- @ReactMethod
816
- public void getContext(ReadableMap locationMap, final Promise promise) {
817
- if (promise == null) {
818
- return;
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
@@ -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;
@@ -1,2 +1,172 @@
1
1
  export default styles;
2
- declare const styles: any;
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
+ }
@@ -1 +1 @@
1
- github "radarlabs/radar-sdk-ios" "3.18.0"
1
+ github "radarlabs/radar-sdk-ios" "3.18.3"
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.1-beta.1" forKey:@"radar-xPlatformSDKVersion"];
105
+ [[NSUserDefaults standardUserDefaults] setObject:@"3.18.2" forKey:@"radar-xPlatformSDKVersion"];
106
106
  [Radar initializeWithPublishableKey:publishableKey];
107
107
  }
108
108
 
@@ -193,7 +193,7 @@ RCT_EXPORT_METHOD(requestPermissions:(BOOL)background resolve:(RCTPromiseResolve
193
193
 
194
194
  CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
195
195
  if (background && status == kCLAuthorizationStatusAuthorizedWhenInUse) {
196
- // Do nothing in this version
196
+ [locationManager requestAlwaysAuthorization];
197
197
  } else if (status == kCLAuthorizationStatusNotDetermined) {
198
198
  [locationManager requestWhenInUseAuthorization];
199
199
  } else {
@@ -1152,9 +1152,9 @@ RCT_EXPORT_METHOD(logConversion:(NSDictionary *)optionsDict resolve:(RCTPromiseR
1152
1152
  };
1153
1153
 
1154
1154
  if (revenue) {
1155
- [Radar logConversionWithName:name metadata:metadata completionHandler:completionHandler];
1156
- } else {
1157
1155
  [Radar logConversionWithName:name revenue:revenue metadata:metadata completionHandler:completionHandler];
1156
+ } else {
1157
+ [Radar logConversionWithName:name metadata:metadata completionHandler:completionHandler];
1158
1158
  }
1159
1159
  }
1160
1160
 
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.1-beta.1",
6
+ "version": "3.18.2",
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": "^47.0.0",
69
- "expo-module-scripts": "^3.4.1",
70
- "jest": "^23.6.0",
71
- "jest-junit": "^5.2.0",
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": "16.8.6",
76
- "react-native": "0.60.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,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.18.0'") === -1) {
54
+ if (contents.indexOf("pod 'RadarSDKMotion', '3.18.3'") === -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.18.0'`);
63
+ const updatedTargetBlock = targetBlock.replace(/(target '(\w+)' do)/, `$1\n pod 'RadarSDKMotion', '3.18.3'`);
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.18.0"
18
+ s.dependency "RadarSDK", "~> 3.18.3"
19
19
  end