radarlabs / react-native-radar

React Native module for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
170 stars 32 forks source link

startTrackingCustom never firing location event? #155

Closed samwoolertonFosters closed 1 year ago

samwoolertonFosters commented 3 years ago

Summary

I'm working on implementing the React Native SDK, and background tracking with startTrackingCustom isn't working. I've tested successfully with startTrackingContinuous and startTrackingResponsive, but startTrackingCustom never fires the location event.

I've tried both copying the config from the docs and using a custom config that's almost identical to the Responsive config (both with sync enabled and disabled).

Ultimately I just want a version of the Responsive config that doesn't send the user's location to a server; our app does all location processing on-device to provide strong privacy guarantees to users.

Why is this custom config never firing the location event, and what do I need to change?

OS version:

iOS 14.8

SDK version

3.1.6

Example code

Most recent config attempt for reference:

Radar.startTrackingCustom({
    desiredStoppedUpdateInterval: 0,
    desiredMovingUpdateInterval: 60,
    desiredSyncInterval: 20,
    desiredAccuracy: "high",
    stopDuration: 140,
    stopDistance: 50,
    sync: "all",
    replay: "none",
    showBlueBar: false,
  })
brettguenther commented 1 year ago

@samwoolertonFosters apologies for the lack of response here. If you are still experiencing issues, please file a new issue and we can investigate.

Given you are using a desiredMovingUpdateInterval of 0, you need the useStoppedGeofence tracking option set to true. This will set a client side geofence around the device's stopped location and enable Radar to detect when the device is moving again. When the device starts moving again the desiredMovingUpdateInterval should kick in to request updates every 60 seconds.