Product

Open-source Radar SDK v3 with custom tracking options, now in public beta

At Radar, we've spent years working to build the most developer-friendly location SDK.

Today, we're releasing a public beta of SDK v3. We're introducing new tracking options that make the SDK more flexible than ever. We're also exposing new APIs for geocoding, search, and distance, now in private beta. And we're open-sourcing our SDK for the first time.

v3

v3 expands on the tracking options in v2 and introduces new tracking options, with the following presets:

  • EFFICIENT, with a low frequency of location updates and lowest battery usage. On Android, guarantees that the SDK never exceeds Android vitals bad behavior thresholds.
  • RESPONSIVE, with a medium frequency of location updates and low battery usage. Suitable for most consumer use cases.
  • CONTINUOUS, with a high frequency of location updates and higher battery usage. Suitable for on-demand use cases (e.g., delivery tracking) and some consumer use cases (e.g., order ahead, "mall mode").

You can also customize these presets or provide a fully custom bundle of tracking options. Intervals, accuracy, stop detection, start and stop times, and offline replay are all configurable:

// default
Radar.startTracking()

// presets
Radar.startTracking(.efficient)
Radar.startTracking(.responsive)
Radar.startTracking(.continuous)

// custom
Radar.startTracking({
  desiredMovingUpdateInterval: 60,
  desiredStoppedUpdateInterval: 180,
  desiredAccuracy: .high,
  stopDuration: 50,
  stopDistance: 30,
  stopTrackingAfter: date,
  sync: .all
})

v3 also introduces a new Radar.getContext() function. Unlike Radar.trackOnce(), this function does not send identifiers to the server or persist user state, great for on-device context and privacy-first use cases:

// stateful
Radar.trackOnce { (status, location, events, user) in
  // do something with user?.geofences, user?.place
}

// stateless
Radar.getContext { (status, location, context) in
  // do something with context?.geofences, context?.place
}

Finally, v3 exposes new search, geocoding, and distance APIs, currently in private beta:

Radar.searchGeofences(
  tags: ["venue"],
  limit: 100
) { (status, geofences) in
  // do something with geofences
}

Radar.searchPlaces(
  chains: ["mcdonalds"],
  radius: 10000
) { (status, places) in
  // do something with places
}

Radar.autocomplete(
  query: "brooklyn roasting",
  near: CLLocation(latitude: 40.70390, longitude: -73.98670),
  limit: 10
) { (status, addresses) in
  // do something with addresses
}

Radar.geocode(
  address: "20 jay st brooklyn"
) { (status, location) in
  // do something with location
}

Radar.reverseGeocode(
  location: CLLocation(latitude: 40.70390, longitude: -73.98670)
) { (status, addresses) in
  // do something with addresses
}

Radar.ipGeocode { (status, country) in
  // do something with country?.code
}

Radar.getDistance(
  destination: CLLocation(latitude: 40.70390, longitude: -73.98670),
  modes: [.foot, .car],
  units: .imperial
) { (status, routes) in 
  // do something with routes?.car?.duration.value
}

Learn more about these new APIs here.


Already using Radar? There are minimal breaking changes from SDK v2, so upgrading is fast and easy. Check out the iOS migration guide and the Android migration guide.

New to Radar? Sign up, then check out the SDK documentation and migration guides to get started.

Want to stay in the loop about new launches? Subscribe to the newsletter below.

Happy coding!