react-native-radar 3.4.0 → 3.4.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.
@@ -23,6 +23,7 @@ import com.facebook.react.modules.core.PermissionAwareActivity;
23
23
  import com.facebook.react.modules.core.PermissionListener;
24
24
  import io.radar.sdk.Radar;
25
25
  import io.radar.sdk.RadarTrackingOptions;
26
+ import io.radar.sdk.RadarTrackingOptions.RadarTrackingOptionsForegroundService;
26
27
  import io.radar.sdk.RadarTripOptions;
27
28
  import io.radar.sdk.model.RadarAddress;
28
29
  import io.radar.sdk.model.RadarContext;
@@ -320,6 +321,17 @@ public class RNRadarModule extends ReactContextBaseJavaModule implements Permiss
320
321
  Radar.stopTracking();
321
322
  }
322
323
 
324
+ @ReactMethod
325
+ public void setForegroundServiceOptions(ReadableMap optionsMap) {
326
+ try {
327
+ JSONObject optionsObj = RNRadarUtils.jsonForMap(optionsMap);
328
+ RadarTrackingOptionsForegroundService options = RadarTrackingOptionsForegroundService.fromJson(optionsObj);
329
+ Radar.setForegroundServiceOptions(options);
330
+ } catch (JSONException e) {
331
+ Log.e(TAG, "JSONException", e);
332
+ }
333
+ }
334
+
323
335
  @ReactMethod
324
336
  public void acceptEvent(String eventId, String verifiedPlaceId) {
325
337
  Radar.acceptEvent(eventId, verifiedPlaceId);
package/ios/RNRadar.m CHANGED
@@ -306,6 +306,10 @@ RCT_EXPORT_METHOD(stopTracking) {
306
306
  [Radar stopTracking];
307
307
  }
308
308
 
309
+ RCT_EXPORT_METHOD(setForegroundServiceOptions) {
310
+ // not implemented
311
+ }
312
+
309
313
  RCT_EXPORT_METHOD(acceptEvent:(NSString *)eventId verifiedPlaceId:(NSString *)verifiedPlaceId) {
310
314
  [Radar acceptEventId:eventId verifiedPlaceId:verifiedPlaceId];
311
315
  }
package/js/index.js CHANGED
@@ -62,6 +62,10 @@ const stopTracking = () => (
62
62
  NativeModules.RNRadar.stopTracking()
63
63
  );
64
64
 
65
+ const setForegroundServiceOptions = options => (
66
+ NativeModules.RNRadar.setForegroundServiceOptions(options)
67
+ );
68
+
65
69
  const startTrip = options => (
66
70
  NativeModules.RNRadar.startTrip(options)
67
71
  );
@@ -149,6 +153,7 @@ const Radar = {
149
153
  startTrackingCustom,
150
154
  mockTracking,
151
155
  stopTracking,
156
+ setForegroundServiceOptions,
152
157
  acceptEvent,
153
158
  rejectEvent,
154
159
  startTrip,
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.4.0",
6
+ "version": "3.4.1",
7
7
  "main": "js/index.js",
8
8
  "files": [
9
9
  "android",