react-native-radar 3.8.11 → 3.8.12-beta.1

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.8.11'
21
+ versionName '3.8.12-beta.1'
22
22
  }
23
23
  lintOptions {
24
24
  abortOnError false
@@ -45,5 +45,5 @@ repositories {
45
45
 
46
46
  dependencies {
47
47
  api 'com.facebook.react:react-native:+'
48
- api 'io.radar:sdk:3.8.11'
48
+ api 'io.radar:sdk:3.8.12'
49
49
  }
@@ -132,6 +132,20 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
132
132
  promise.resolve(Radar.getDescription());
133
133
  }
134
134
 
135
+ @ReactMethod
136
+ public void nativeSdkVersion(final Promise promise) {
137
+ if (promise == null) {
138
+ return;
139
+ }
140
+ String sdkVersion = Radar.sdkVersion();
141
+
142
+ if (sdkVersion != null) {
143
+ promise.resolve(sdkVersion);
144
+ } else {
145
+ promise.reject(Radar.RadarStatus.ERROR_BAD_REQUEST.toString(), Radar.RadarStatus.ERROR_BAD_REQUEST.toString());
146
+ }
147
+ }
148
+
135
149
  @ReactMethod
136
150
  public void setMetadata(ReadableMap metadataMap) throws JSONException {
137
151
  Radar.setMetadata(RNRadarUtils.jsonForMap(metadataMap));
@@ -420,6 +434,11 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
420
434
  Radar.startTracking(RadarTrackingOptions.CONTINUOUS);
421
435
  }
422
436
 
437
+ @ReactMethod
438
+ public void startTrackingVerified(boolean token) {
439
+ //not implemented
440
+ }
441
+
423
442
  @ReactMethod
424
443
  public void startTrackingCustom(ReadableMap optionsMap) {
425
444
  try {
@@ -1 +1 @@
1
- github "radarlabs/radar-sdk-ios" "3.8.8"
1
+ github "radarlabs/radar-sdk-ios" "3.8.10-beta.1"
package/ios/RNRadar.m CHANGED
@@ -16,6 +16,7 @@ RCT_EXPORT_MODULE();
16
16
  self = [super init];
17
17
  if (self) {
18
18
  [Radar setDelegate:self];
19
+ [Radar setVerifiedDelegate:self];
19
20
  locationManager = [CLLocationManager new];
20
21
  locationManager.delegate = self;
21
22
  }
@@ -38,7 +39,7 @@ RCT_EXPORT_MODULE();
38
39
  }
39
40
 
40
41
  - (NSArray<NSString *> *)supportedEvents {
41
- return @[@"events", @"location", @"clientLocation", @"error", @"log"];
42
+ return @[@"events", @"location", @"clientLocation", @"error", @"log", @"token"];
42
43
  }
43
44
 
44
45
  - (void)startObserving {
@@ -91,6 +92,12 @@ RCT_EXPORT_MODULE();
91
92
  }
92
93
  }
93
94
 
95
+ - (void)didUpdateToken:(NSString *)token {
96
+ if(hasListeners) {
97
+ [self sendEventWithName:@"token" body:token];
98
+ }
99
+ }
100
+
94
101
  RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud) {
95
102
  [Radar initializeWithPublishableKey:publishableKey];
96
103
  }
@@ -119,6 +126,10 @@ RCT_EXPORT_METHOD(getUserId:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRe
119
126
  resolve([Radar getUserId]);
120
127
  }
121
128
 
129
+ RCT_EXPORT_METHOD(nativeSdkVersion:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject){
130
+ resolve([Radar sdkVersion]);
131
+ }
132
+
122
133
  RCT_EXPORT_METHOD(setDescription:(NSString *)description) {
123
134
  [Radar setDescription:description];
124
135
  }
@@ -353,6 +364,10 @@ RCT_EXPORT_METHOD(startTrackingContinuous) {
353
364
  [Radar startTrackingWithOptions:RadarTrackingOptions.presetContinuous];
354
365
  }
355
366
 
367
+ RCT_EXPORT_METHOD(startTrackingVerified:(BOOL)token) {
368
+ [Radar startTrackingVerified:token];
369
+ }
370
+
356
371
  RCT_EXPORT_METHOD(startTrackingCustom:(NSDictionary *)optionsDict) {
357
372
  RadarTrackingOptions *options = [RadarTrackingOptions trackingOptionsFromDictionary:optionsDict];
358
373
  [Radar startTrackingWithOptions:options];
@@ -1,4 +1,5 @@
1
1
  import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
2
+ import { version } from '../package.json'
2
3
 
3
4
  if (!NativeModules.RNRadar && (Platform.OS === 'ios' || Platform.OS === 'android')) {
4
5
  throw new Error('NativeModules.RNRadar is undefined');
@@ -90,6 +91,10 @@ const startTrackingCustom = options => (
90
91
  NativeModules.RNRadar.startTrackingCustom(options)
91
92
  );
92
93
 
94
+ const startTrackingVerified = token => (
95
+ NativeModules.RNRadar.startTrackingVerified(token)
96
+ );
97
+
93
98
  const mockTracking = options => (
94
99
  NativeModules.RNRadar.mockTracking(options)
95
100
  );
@@ -198,6 +203,12 @@ const off = (event, callback) => {
198
203
  }
199
204
  };
200
205
 
206
+ const nativeSdkVersion = () => (
207
+ NativeModules.RNRadar.nativeSdkVersion()
208
+ );
209
+
210
+ const rnSdkVersion = () => (version)
211
+
201
212
  const Radar = {
202
213
  initialize,
203
214
  setLogLevel,
@@ -215,6 +226,7 @@ const Radar = {
215
226
  trackOnce,
216
227
  trackVerified,
217
228
  trackVerifiedToken,
229
+ startTrackingVerified,
218
230
  startTrackingEfficient,
219
231
  startTrackingResponsive,
220
232
  startTrackingContinuous,
@@ -244,6 +256,8 @@ const Radar = {
244
256
  sendEvent,
245
257
  on,
246
258
  off,
259
+ nativeSdkVersion,
260
+ rnSdkVersion,
247
261
  };
248
262
 
249
263
  export default Radar;
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.8.11",
6
+ "version": "3.8.12-beta.1",
7
7
  "main": "js/index.js",
8
8
  "files": [
9
9
  "android",
@@ -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.8.8"
18
+ s.dependency "RadarSDK", "~> 3.8.10-beta.1"
19
19
  end