Skip to main content

Testing

Use this guide to troubleshoot issues with location tracking and event generation.

Device is not showing up in the dashboard#

A device will show up in the Radar dashboard once a successful track API call has been sent to the server. The Radar SDK collects location updates and then sends them to the server via the track API.

Common issues#

  • Location permissions have not been granted.
  • The Radar SDK has not been properly initialized.
  • Radar tracking methods have not been implemented correctly.

Troubleshooting steps#

  1. Verify location permissions have been granted.
  2. Verify that initializing the SDK uses the correct publishable key and happens during application launch. This initialization should happen in the onCreate() method of the Application class on Android and the didFinishLaunchingWithOptions() method of the AppDelegate on iOS.
  3. Call Radar.trackOnce() on application launch and log the status in the callback. Refer to the iOS and Android implementations to understand the status values returned.
  4. Call Radar.setLogLevel() with a value of debug and monitor for errors in the logs. Refer to the debug logging sections of iOS and Android for more detail.

A successful Radar API request log looks like the following:

2022-11-08 11:33:01.784759-0500 RadarImplementation[6947:250060] 📍 Radar API response | method = POST; url = https://api.radar.io/v1/track; statusCode = 200;

Once a successful API call is made, there will be a corresponding user on the Users page in the dashboard.

Verify that Radar is registering users on the Users page:

Users Page

Events are not firing when the app is backgrounded#

As the Radar SDK collects location updates and sends them to the server, it will generate events based on location context (e.g., the device moves into or out of a geofence or starts a trip). Generated events will appear on the Events page in the dashboard if location updates are triggering events as expected. If the device's last location is in a geofence or a place, that information will be displayed on the details page for that user.

Common issues#

  • Background location permissions have not been granted.
  • Radar events are not enabled on the Settings page in the dashboard.
  • Radar tracking methods have not been implemented correctly.
  • The test device has issues collecting location updates (e.g., location sensors are not working in the simulator).
  • Flawed testing based on the tracking options applied (e.g., geofence stop detection is on, but the device is not dwelling long enough to detect a stop).

Troubleshooting steps#

  1. Verify that initializing the SDK uses the correct publishable key and happens during application launch. This initialization should happen in the onCreate() method of the Application class on Android and the didFinishLaunchingWithOptions() method of the AppDelegate on iOS. On iOS, verify that the Location updates background mode has been enabled if using the responsive or continuous presets.
  2. Confirm that events are enabled for the context type you are testing on the Settings page.
  3. Confirm that you are calling Radar.startTracking().
  4. Determine the behavior needed to trigger location updates based on the tracking options in use and verify that they appear in the Radar dashboard. For example, if the device is stopped in responsive mode, move over 200 meters to trigger a location update. Location updates can be verified on the Users page in the dashboard or on the User Activity page.
  5. If location updates are still not appearing, call Radar.setLogLevel() with a value of debug and monitor for errors in the logs. Refer to the debug logging sections of iOS and Android for more detail.

Verify that events are firing on the Events page:

Recent Events

Verify a device's current geofences on the User details page:

User Details

Note: a device needs to exit a geofence before generating a subsequent entry event, so ensure that the device has been detected outside of the geofence prior to testing another entry.

Event listeners are not delivering#

Common issues#

  • Radar event listeners are not implemented correctly.
  • Radar events are not generating from location updates.

Troubleshooting steps#

  1. Verify the RadarDelegate on iOS and RadarReceiver on Android are implemented correctly. For cross-platform frameworks such as React Native and Capacitor, ensure that the listeners are set up outside of the view lifecycle. Verify that you are using the correct native SDK version via the Users page in the dashboard.
  2. Verify that expected events are firing when testing the listeners.
  3. Understand the behavior of each of the listeners. The client location listener (onClientLocationUpdated on Android, didUpdateClientLocation on iOS) is triggered whenever the Radar SDK receives an update from the device. The location updated listener (onLocationUpdated on Android, didUpdateLocation on iOS) delivers location updates processed by Radar servers and will return refreshed user context. The Radar events listener (didReceiveEvents on Android and iOS) will only fire if events are triggered from location updates.
  4. Implement the error listener methods (onError on Android, didFail on iOS) to determine if errors are firing. Review the error messages returned to diagnose the root cause.

Troubleshooting other behavior#

Multiple Radar users have the same user ID or device ID#

The Radar iOS and Android SDKs automatically generate a unique installId on every fresh install. Radar creates a new user record for every unique installId. Multiple user records may have the same userId value or deviceId value if they have different installId values. Multiple users generating without uninstalls indicates a potential issue setting the userId in the SDK (i.e. passing in null for the userId in certain scenarios).

Rate limit errors are occurring when tracking location#

Radar has device specific rate limits per second, hour and day for the track API endpoint, which sends location updates to Radar. To mitigate rate limits, adjust tracking options to collect locations less frequently. If you hit the per hour or day limits while testing, reinstalling the application with the Radar SDK will reset the rate limits.